refresh
This commit is contained in:
parent
b78bd71a47
commit
d14dd3ead3
@ -46,8 +46,7 @@ int main() {
|
|||||||
char name[namemax];
|
char name[namemax];
|
||||||
|
|
||||||
if (sscanf(buffer, "%d %99[^\n]", &golosa, name) != 2 || golosa <= 0) {
|
if (sscanf(buffer, "%d %99[^\n]", &golosa, name) != 2 || golosa <= 0) {
|
||||||
printf("Chyba: Nepodarilo sa nacitat ziadny zaznam.\n");
|
continue; // Пропускаем ошибочную строку
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = find_student(students, count, name);
|
int index = find_student(students, count, name);
|
||||||
@ -68,7 +67,7 @@ int main() {
|
|||||||
|
|
||||||
qsort(students, count, sizeof(Student), compare);
|
qsort(students, count, sizeof(Student), compare);
|
||||||
|
|
||||||
printf("Vysledky:\n"); // Добавляем строку "Vysledky:" перед выводом результатов
|
printf("Vysledky:\n");
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
printf("%d %s\n", students[i].golosa, students[i].name);
|
printf("%d %s\n", students[i].golosa, students[i].name);
|
||||||
|
Loading…
Reference in New Issue
Block a user