This commit is contained in:
Weber 2024-03-22 00:41:10 +00:00
parent 301029a4cd
commit a4df11eb59

View File

@ -35,9 +35,7 @@ int main() {
if (student_count == 0) { if (student_count == 0) {
total_votes = vote_count; total_votes = vote_count;
continue; } else {
}
int existing_student_index = -1; int existing_student_index = -1;
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) {
@ -64,8 +62,11 @@ int main() {
student_count++; student_count++;
} }
} }
}
if (student_count == 1) { if (student_count == 0) {
printf("Žiadni študenti.\n");
} else if (student_count == 1) {
printf("Vysledky:\n"); printf("Vysledky:\n");
printf("%d %s\n", total_votes, students[0].name); printf("%d %s\n", total_votes, students[0].name);
} else { } else {