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