From 5a39edd182eb9ce6babf87e48560d19551b3267a Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:04:22 +0000 Subject: Mon, Feb 19, 2024, 2:04 PM -08:00 --- wk3/pset/runoff/runoff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wk3/pset') 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; } } -- cgit v1.2.3