-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVoting.h
33 lines (26 loc) · 901 Bytes
/
Voting.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// --------------------------
// projects/voting/Voting.h
// Copyright (C) 2015
// Glenn P. Downing
// --------------------------
#ifndef Voting_h
#define Voting_h
// --------
// includes
// --------
#include <cassert>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
void reassign(vector<int>& count, vector<int>& losers, vector<vector<string> >& ballots, vector<int>& losers_total);
bool check(int& v, vector<int>& losers_total);
bool winner(vector<int>& count, vector<string>& electees, vector<int>& losers, vector<string>& candidates, vector<int>& losers_total);
void sortVotes(istream& r, vector< vector<string> >& ballots, vector<int>& count, string& v);
void elect (istream& r, ostream& w);
void print(ostream& w, vector<string>& winners);
void run_cases (istream& r, ostream& w);
#endif // Voting_h