From 42acfb719af4d25a1250ae0118150919d63c2b15 Mon Sep 17 00:00:00 2001 From: ak643du Date: Mon, 22 Apr 2024 18:06:42 +0200 Subject: [PATCH] Initialization --- cv10/program.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cv10/program.c b/cv10/program.c index c4f4a8f..fc33e68 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -8,7 +8,6 @@ int main() { int max_students, num_accepted = 0; char names[MAX_STUDENTS][NAME_SIZE]; char temp_name[NAME_SIZE]; - int num_rejected = max_students; scanf("%d", &max_students); if (max_students <= 0 || max_students > MAX_STUDENTS) { @@ -41,14 +40,10 @@ int main() { printf("Prijati studenti:"); for (int i = 0; i < num_accepted; i++) { printf("%s", names[i]); - if (i < num_accepted - 1) { - printf("\n"); - } } - num_rejected -= num_accepted; } - if (num_rejected > 0) { + if (num_accepted < max_students) { printf("Neprijati studenti:"); for (int i = num_accepted; i < max_students; i++) { printf("%s", names[i]);