test
This commit is contained in:
parent
a4df11eb59
commit
aa10463424
@ -36,7 +36,7 @@ int main() {
|
|||||||
if (student_count == 0) {
|
if (student_count == 0) {
|
||||||
total_votes = vote_count;
|
total_votes = vote_count;
|
||||||
} else {
|
} else {
|
||||||
int existing_student_index = -1;
|
int existing_student_index = 0;
|
||||||
for (int i = 0; i < student_count; i++) {
|
for (int i = 0; i < student_count; i++) {
|
||||||
if (strcmp(students[i].name, name) == 0) {
|
if (strcmp(students[i].name, name) == 0) {
|
||||||
existing_student_index = i;
|
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;
|
students[existing_student_index].vote_count += vote_count;
|
||||||
} else {
|
} else {
|
||||||
if (student_count >= students_capacity) {
|
if (student_count >= students_capacity) {
|
||||||
|
Loading…
Reference in New Issue
Block a user