Изменить 'du6/program.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-04-16 10:58:46 +00:00
parent 62c7779b2a
commit 7c15bb5fb2

View File

@ -41,21 +41,7 @@ int main() {
}
//The code below orders the applicants by name (a-z)
int changesMade = 1;
while(changesMade){
changesMade = 0;
for(int i = 0; i < finalPosition; i++){
while(inputs[i][count] == inputs[i + 1][count])
count++;
if(inputs[i][count] > inputs[i + 1][count]){
changesMade = 1;
strcpy(temp, inputs[i]);
strcpy(inputs[i], inputs[i + 1]);
strcpy(inputs[i + 1], temp);
}
count = 0;
}
}
qsort(inputs, finalPosition+1, 50*sizeof(char), strcmp);
printf("Prijati studenti:\n");
for(int i = 1; i <= freePlaces; i++){