From ca4f70c993cc031228836e2270768ce7d0310201 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 9 Apr 2020 23:18:30 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu5/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du5/program.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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