summaryrefslogtreecommitdiff
path: root/wk3/pset
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:00:02 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:00:02 +0000
commit558ff3160355b197000de5c49c9090a83bd939d3 (patch)
treee7f4e479624c083c2df540602698eca94742f07d /wk3/pset
parent41305528e75880ac1cd0025f53f831104817edb5 (diff)
Mon, Feb 19, 2024, 2:00 PM -08:00
Diffstat (limited to 'wk3/pset')
-rw-r--r--wk3/pset/runoff/runoff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c
index 17b4bf2..6fdfbe5 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
-int preferences[MAX_VOTERS][MAX_CANDIDATES];
+string preferences[MAX_VOTERS][MAX_CANDIDATES];
// Candidates have name, vote count, eliminated status
typedef struct
@@ -168,7 +168,7 @@ bool print_winner(void)
{
if (candidates[i].votes > (voter_count / 2))
{
- printf("%s", candidate.name);
+ printf("%s", candidates[i].name);
}
}
return false;