From d50eb79d0f98d87e8bddff726e81f539958bf370 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 9 Apr 2020 23:22:43 +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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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