diff --git a/cv10/program.c b/cv10/program.c index fc33e68..c4f4a8f 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -8,6 +8,7 @@ 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) { @@ -40,10 +41,14 @@ 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_accepted < max_students) { + if (num_rejected > 0) { printf("Neprijati studenti:"); for (int i = num_accepted; i < max_students; i++) { printf("%s", names[i]);