Aktualizovat „du5/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-09 23:13:20 +00:00
parent 94423e22b3
commit 1dbd46afb2

View File

@ -65,7 +65,7 @@ int main(){
} }
//int flag=0; int flag=0;
qsort(PersonList,c,sizeof(struct person),comp_num); qsort(PersonList,c,sizeof(struct person),comp_num);
int k =0; int k =0;
@ -77,16 +77,17 @@ int main(){
PersonList[j] = PersonList[j+1]; PersonList[j] = PersonList[j+1];
PersonList[j+1]=temp; PersonList[j+1]=temp;
k++; k++;
flag=1;
} }
} }
} }
if(c>1){ if(flag==1){
k--; k--;
} }
else{ else{
k=1; k=c;
} }
printf("Vysledky:\n"); printf("Vysledky:\n");
for(int i =0;i<k;i++){ for(int i =0;i<k;i++){