This commit is contained in:
Patrik Seman 2023-04-15 11:56:12 +02:00
parent 78d996f608
commit 2328b025f4
2 changed files with 20 additions and 2 deletions

Binary file not shown.

View File

@ -24,19 +24,37 @@ int main(){
if(pocet>pocet_mien){ if(pocet>pocet_mien){
pocet=pocet_mien; pocet=pocet_mien;
} }
int index=0;
puts("Prijati studenti:"); puts("Prijati studenti:");
for(int i=0; i<pocet; i++){ for(int i=0; i<pocet; i++){
printf("%s\n", mena[i]); while(strcmp(mena[index], mena[index +1])==0){
index++;
}
if(index>=pocet_mien){
return 0;
}
printf("%s\n", mena[index]);
index++;
} }
if(pocet<pocet_mien){ if(pocet<pocet_mien){
puts("Neprijati studenti:"); puts("Neprijati studenti:");
for(int i=pocet; i<pocet_mien; i++){ for(int i=pocet; i<pocet_mien; i++){
printf("%s\n", mena[i]); while(strcmp(mena[index], mena[index +1])==0){
index++;
}
if(index>=pocet_mien){
return 0;
}
printf("%s\n", mena[index]);
index++;
} }
} }
return 0; return 0;
} }