Aktualizovat "program.c

This commit is contained in:
Michal Čabra 2019-10-25 11:02:02 +00:00
parent bba0e9d4e9
commit 843d229eed

View File

@ -23,12 +23,24 @@ int compare_pizza(const void * left, const void * right) {
return -1; return -1;
} }
else{ else{
if(a->name[0] > b->name[0]){ i=0;
while(1){
if(a->name[i]=='\n' || b->name[i]=='\n'){
break;
}
else if(a->name[i]=='\r' || b->name[i]=='\r'){
break;
}
else if(a->name[i] > b->name[i]){
return 1; return 1;
}
else{
i++
}
} }
else{ return -1;
return -1;
}
} }
} }