Initialization

This commit is contained in:
Kozar 2024-04-25 17:59:26 +02:00
parent 81ca9d6d44
commit b3f28e8016

View File

@ -38,22 +38,24 @@ int main() {
if (num_accepted == 0) { if (num_accepted == 0) {
printf("Ziadne prihlasky"); printf("Ziadne prihlasky");
} else { } else {
printf("Prijati studenti:\n"); printf("Prijati studenti:");
for (int i = 0; i < num_accepted; i++) { for (int i = 0; i < num_accepted; i++) {
printf("%s", names[i]); printf("%s", names[i]);
} }
printf("\nNeprijati studenti:\n"); if (num_students > num_accepted) {
for (int i = 0; i < num_students; i++) { printf("Neprijati studenti:");
int found = 0; for (int i = 0; i < num_students; i++) {
for (int j = 0; j < num_accepted; j++) { int found = 0;
if (strcmp(names[j], temp_name) == 0) { for (int j = 0; j < num_accepted; j++) {
found = 1; if (strcmp(names[j], temp_name) == 0) {
break; found = 1;
break;
}
}
if (!found) {
printf("%s", temp_name);
} }
}
if (!found) {
printf("%s", temp_name);
} }
} }
} }