From e98cdabb86c1ab2f64ceef810b372a8e9fbedd06 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 16 Apr 2020 15:30:46 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'du6/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du6/program.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/du6/program.c b/du6/program.c index b0cfa1b..7f88e7d 100644 --- a/du6/program.c +++ b/du6/program.c @@ -72,6 +72,11 @@ void sort(struct LIS* list,int count){ if(strcmp(min,list[j].fname)>0){ min=list[j].fname; mini=j; + } + if(strcmp(min,list[j].fname)==0 && strcmp(list[mini].fname,list[j].fname)>0){ + ilusion=list[i]; + list[i]=list[mini]; + list[mini]=ilusion; } } ilusion=list[i]; @@ -110,18 +115,4 @@ void print(struct LIS *list,int count,int places){ else{ puts("Ziadne prihlasky"); } -} - - - - - - - - - - - - - - \ No newline at end of file +} \ No newline at end of file