#include #include #include using namespace std; const int NUMVOTERS = 500; const int NUMCAND = 2500; short ballots[NUMVOTERS][NUMCAND]; int oneOnOne(int c1, int c2, int nvotes, int ncand) { int v1=0, v2=0; for(int i=0; iv2) return c1; else return c2; } int findCondorcet(int nvotes, int ncand) { int c, currWinner = 0; for(c=1; c> nvotes >> ncands; while (nvotes != 0) { icase++; for(i=0; i> val; ballots[i][val] = j; } } int win = findCondorcet(nvotes, ncands); cout << "Case " << icase << ": "; if (win != -1) cout << win << endl; else cout << "No Condorcet winner" << endl; cin >> nvotes >> ncands; } }