diff --git a/cv10/program.c b/cv10/program.c index fc33e68..acabd87 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -5,7 +5,7 @@ #define NAME_SIZE 50 int main() { - int max_students, num_accepted = 0; + int max_students, num_accepted = 0, num_students = 0; char names[MAX_STUDENTS][NAME_SIZE]; char temp_name[NAME_SIZE]; @@ -32,6 +32,7 @@ int main() { strcpy(names[num_accepted], temp_name); num_accepted++; } + num_students++; } if (num_accepted == 0) { @@ -43,7 +44,7 @@ int main() { } } - if (num_accepted < max_students) { + if (num_accepted < max_students && num_accepted < num_students) { printf("Neprijati studenti:"); for (int i = num_accepted; i < max_students; i++) { printf("%s", names[i]);