diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-02-19 22:04:22 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-02-19 22:04:22 +0000 |
commit | 5a39edd182eb9ce6babf87e48560d19551b3267a (patch) | |
tree | 189b48c0b54773842c930ded903f79b222a511ff /wk3/pset/runoff | |
parent | ff238ce76fefc87174c458792eda49962939800d (diff) |
Mon, Feb 19, 2024, 2:04 PM -08:00
Diffstat (limited to 'wk3/pset/runoff')
-rw-r--r-- | wk3/pset/runoff/runoff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c index a193adf..ae69ce3 100644 --- a/wk3/pset/runoff/runoff.c +++ b/wk3/pset/runoff/runoff.c @@ -7,7 +7,7 @@ #define MAX_CANDIDATES 9 // preferences[i][j] is jth preference for voter i -string preferences[MAX_VOTERS][MAX_CANDIDATES]; +int preferences[MAX_VOTERS][MAX_CANDIDATES]; // Candidates have name, vote count, eliminated status typedef struct @@ -131,7 +131,7 @@ bool vote(int voter, int rank, string name) { if (!strcmp(name, candidates[i].name)) { - preferences[voter][rank] = candidates[i].name; + preferences[voter][rank] = i; return true; } } |