From f1e642ca370cccbf6ee2c85e1a7109a20bc92cb0 Mon Sep 17 00:00:00 2001 From: Weber Date: Wed, 24 Apr 2024 10:05:16 +0000 Subject: [PATCH] test --- cv10/program.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cv10/program.c b/cv10/program.c index 3fc4d35..0f06b3b 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -6,9 +6,11 @@ int main() { int maxStudents; + printf("Zadajte maximálny počet študentov na prijatie: "); scanf("%d", &maxStudents); if (maxStudents <= 0) { + printf("Nespravny vstup\n"); return 1; } @@ -24,11 +26,13 @@ int main() { numStudents++; if (numStudents >= MAX_STUDENTS) { + printf("Príliš veľa študentov. Zvážte navýšenie MAX_STUDENTS.\n"); return 1; } } if (numStudents == 0) { + printf("Ziadne prihlášky\n"); return 1; } @@ -44,11 +48,13 @@ int main() { qsort(names, numStudents, sizeof(names[0]), strcmp); + printf("\nPrijati studenti:\n"); for (int i = 0; i < maxStudents && i < numStudents; i++) { printf("%s\n", names[i]); } if (numStudents > maxStudents) { + printf("\nNeprijati studenti:\n"); for (int i = maxStudents; i < numStudents; i++) { printf("%s\n", names[i]); }