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