Изменить 'du5/program.c'
This commit is contained in:
		
							parent
							
								
									1aa9067447
								
							
						
					
					
						commit
						566680fe06
					
				| @ -32,6 +32,7 @@ int keep(struct LIS *list){ | |||||||
| char *array; | char *array; | ||||||
| int stop,count; | int stop,count; | ||||||
| int num; | int num; | ||||||
|  | int ss; | ||||||
|     for(int i=0; stop!=EOF; i++){ |     for(int i=0; stop!=EOF; i++){ | ||||||
|         array=(char*)malloc(100); |         array=(char*)malloc(100); | ||||||
|         stop =0; |         stop =0; | ||||||
| @ -63,22 +64,17 @@ int del(struct LIS *list,int count){ | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Sort_Struct(struct LIS *list,int count){ | void Sort_Struct(struct LIS *list,int count){ | ||||||
|     struct LIS ilusion; |  | ||||||
| 
 | 
 | ||||||
|  |     struct LIS ilusion; | ||||||
|     for(int i=0;i<count;i++){ |     for(int i=0;i<count;i++){ | ||||||
|         for(int j=i;j>1;j--){ |         for(int j=count;j>i;j--){ | ||||||
|             if(strcmp(list[i].sname,list[j].sname)!=0){ |             if(list[i].num<list[j].num){ | ||||||
|             for(int k=0;k<strlen(list[i].sname);k++){ |  | ||||||
|                 if(list[i].sname[k]>list[j].sname[k]){ |  | ||||||
|                ilusion=list[i]; |                ilusion=list[i]; | ||||||
|                list[i]=list[j]; |                list[i]=list[j]; | ||||||
|                     list[j]=list[i]; |                list[j]=ilusion; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|              |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void print(struct LIS *list,int count){ | void print(struct LIS *list,int count){ | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user