Изменить 'du6/program.c'

This commit is contained in:
Pavlo Tverdyi 2020-04-16 16:10:25 +00:00
parent d5596e0aa6
commit b83ab19fab

View File

@ -66,12 +66,20 @@ void sort(struct LIS* list,int count){
char *min; char *min;
int mini; int mini;
for(int i=0;i<=count-1;i++){ for(int i=0;i<=count-1;i++){
if(strcmp(list[i].fname,list[i+1].fname)==0 && strcmp(list[i].name,list[i+1].name)>0){ min=list[i].name;
ilusion=list[i]; mini=i;
list[i]=list[i+1]; for(int j=i+1;j<=count;j++){
list[i+1]=ilusion; if(strcmp(min,list[j].name)>0){
i++; min=list[j].name;
mini=j;
} }
}
ilusion=list[i];
list[i]=list[mini];
list[mini]=ilusion;
}
////
for(int i=0;i<=count-1;i++){
min=list[i].fname; min=list[i].fname;
mini=i; mini=i;
for(int j=i+1;j<=count;j++){ for(int j=i+1;j<=count;j++){