From 1dbd46afb258daa5810ac8aa111f73293bff8938 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 9 Apr 2020 23:13:20 +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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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