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

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

View File

@ -66,6 +66,12 @@ void sort(struct LIS* list,int count){
char *min;
int mini;
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){
ilusion=list[i];
list[i]=list[i+1];
list[i+1]=ilusion;
i++;
}
min=list[i].fname;
mini=i;
for(int j=i+1;j<=count;j++){
@ -78,15 +84,6 @@ void sort(struct LIS* list,int count){
list[i]=list[mini];
list[mini]=ilusion;
}
for(int i=0;i<=count-1;i++){
for(int j=1;j<=count;j++){
if(strcmp(list[i].fname,list[j].fname)==0 && strcmp(list[i].name,list[j].name)>0){
ilusion=list[i];
list[i]=list[j];
list[j]=ilusion;
}
}
}
}
void print(struct LIS *list,int count,int places){