From aa10463424fb96e4e0f0e1ca0b1da6bc607c8b89 Mon Sep 17 00:00:00 2001 From: Weber Date: Fri, 22 Mar 2024 00:42:28 +0000 Subject: [PATCH] test --- cv5/program.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index 368421f..ad6d63d 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -36,7 +36,7 @@ int main() { if (student_count == 0) { total_votes = vote_count; } else { - int existing_student_index = -1; + int existing_student_index = 0; for (int i = 0; i < student_count; i++) { if (strcmp(students[i].name, name) == 0) { existing_student_index = i; @@ -44,7 +44,7 @@ int main() { } } - if (existing_student_index != -1) { + if (existing_student_index != 0) { students[existing_student_index].vote_count += vote_count; } else { if (student_count >= students_capacity) {