diff --git a/du5/program.c b/du5/program.c index b2add96..9ac4820 100644 --- a/du5/program.c +++ b/du5/program.c @@ -65,7 +65,7 @@ int main(){ } - //int flag=0; + int flag=0; qsort(PersonList,c,sizeof(struct person),comp_num); int k =0; @@ -77,16 +77,17 @@ int main(){ PersonList[j] = PersonList[j+1]; PersonList[j+1]=temp; k++; + flag=1; } } } - if(c>1){ + if(flag==1){ k--; } else{ - k=1; + k=c; } printf("Vysledky:\n"); for(int i =0;i