diff --git a/du5/program.c b/du5/program.c index 2a75eae..6bc69d9 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,14 +77,19 @@ int main(){ PersonList[j] = PersonList[j+1]; PersonList[j+1]=temp; c--; + flag=1; for (int k=i; k<30; k++){ PersonList[k] = PersonList[k]; - } + } } + else{flag=0;} } } + if(flag ==1){ + c=1; + } printf("Vysledky:\n"); for(int i =0;i