diff --git a/du6/program.c b/du6/program.c index b43d1e5..3322f0a 100644 --- a/du6/program.c +++ b/du6/program.c @@ -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++){