From 2ae393fdd1db64ae1f924c9feb6e5983ae694fc9 Mon Sep 17 00:00:00 2001 From: Miloslav Macko Date: Mon, 15 Apr 2024 22:24:06 +0200 Subject: [PATCH] 123 --- cv10/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cv10/program.c b/cv10/program.c index f43c4df..70506f8 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -19,14 +19,14 @@ int main() { int max_students; if (scanf("%d\n", &max_students) != 1 || max_students <= 0) { puts("Nespravny vstup"); - return 0; // Change this to return 0 + return 0; } char line[SIZE]; while (fgets(line, SIZE, stdin) != NULL) { - line[strcspn(line, "\n")] = 0; // Remove the newline character - int pocet_znakov = strlen(line) + 1; // Include the null terminator - if (pocet_znakov == 1) // Skip empty lines + line[strcspn(line, "\n")] = 0; + int pocet_znakov = strlen(line) + 1; + if (pocet_znakov == 1) continue; // Kontrola duplicĂ­t @@ -46,7 +46,7 @@ int main() { if (pocet_mien_v_poli == 0) { puts("Ziadne prihlasky"); - return 0; // Change this to return 0 + return 0; } // Triedenie