From 5b8ab43104bcd75cf9cb4c127026ee136ffec98f Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 25 Apr 2024 17:31:18 +0200 Subject: [PATCH] Initialization --- cv10/program.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cv10/program.c b/cv10/program.c index f59d1a7..167d124 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -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);