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