Aktualizovat „du5/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-09 20:34:59 +00:00
parent 943d605c48
commit 4917c58d10

View File

@ -68,7 +68,12 @@ int main(){
qsort(PersonList,c,sizeof(struct person),comp_num); qsort(PersonList,c,sizeof(struct person),comp_num);
printf("Vysledky:\n"); printf("Vysledky:\n");
for(int i =0;i<c;i++){ for(int i =0;i<c;i++){
res_strcmp = strcmp(PersonList[i].name,PersonList[i+1].name); if(i+1<c){
res_strcmp = strcmp(PersonList[i].name,PersonList[i+1].name);
}
else{
res_strcmp = strcmp(PersonList[i].name,PersonList[i-1].name);
}
if(res_strcmp!=0){ if(res_strcmp!=0){
flag=0; flag=0;
printf("%d %s\n",PersonList[i].score,PersonList[i].name); printf("%d %s\n",PersonList[i].score,PersonList[i].name);