Initialization

This commit is contained in:
Kozar 2024-04-25 17:31:18 +02:00
parent 23dc469d67
commit 5b8ab43104

View File

@ -25,6 +25,11 @@ int main() {
return 1;
}
if (getchar() == '\n') {
puts("Nespravny vstup");
return 1;
}
if (scanf("%d", &num_students) != 1 || num_students <= 0) {
puts("Nespravny vstup");
return 1;
@ -54,7 +59,7 @@ int main() {
qsort(students, i, sizeof(Student), cmpfunc);
printf("Prijati studenti:\n");
printf("Prijati students:\n");
for (i = 0; i < max_students; i++) {
if (students[i].applied == 1) {
printf("%s\n", students[i].name);