Изменить 'du5/program.c'
This commit is contained in:
parent
566680fe06
commit
1379e394cb
@ -63,8 +63,7 @@ int del(struct LIS *list,int count){
|
||||
return count;
|
||||
}
|
||||
|
||||
void Sort_Struct(struct LIS *list,int count){
|
||||
|
||||
void Sort_Struct(struct LIS *list,int count){//bubble sort :)
|
||||
struct LIS ilusion;
|
||||
for(int i=0;i<count;i++){
|
||||
for(int j=count;j>i;j--){
|
||||
@ -73,6 +72,24 @@ void Sort_Struct(struct LIS *list,int count){
|
||||
list[i]=list[j];
|
||||
list[j]=ilusion;
|
||||
}
|
||||
if(list[i].num==list[j].num){
|
||||
for(int k=0;k<strlen(list[i].sname);k++){
|
||||
if(list[i].sname<list[j].sname){
|
||||
ilusion=list[i];
|
||||
list[i]=list[j];
|
||||
list[j]=ilusion;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(list[i].num==list[j].num && list[i].sname==list[j].sname){
|
||||
for(int l=0;l<strlen(list[i].fname);l++){
|
||||
if(list[i].fname<list[j].fname){
|
||||
ilusion=list[i];
|
||||
list[i]=list[j];
|
||||
list[j]=ilusion;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user