Изменить 'du5/program.c'
This commit is contained in:
		
							parent
							
								
									0f7649658a
								
							
						
					
					
						commit
						3b27c820ff
					
				| @ -15,6 +15,7 @@ int keep(struct LIS *); | ||||
| int del(struct LIS *,int); | ||||
| void Sort_Num(struct LIS *,int); | ||||
| void Sort_Sname(struct LIS *,int); | ||||
| void Sort_Fname(struct LIS *,int); | ||||
| void print(struct LIS *,int); | ||||
| 
 | ||||
| 
 | ||||
| @ -24,6 +25,7 @@ int count=keep(list); | ||||
| int pult=del(list,count); | ||||
| Sort_Num(list,count); | ||||
| Sort_Sname(list,count); | ||||
| Sort_Fname(list,count); | ||||
| print(list,pult); | ||||
|     return 0; | ||||
| } | ||||
| @ -74,6 +76,18 @@ void Sort_Sname(struct LIS *list,int count){ | ||||
|         } | ||||
|     } | ||||
| } | ||||
| void Sort_Fname(struct LIS *list,int count){ | ||||
|     struct LIS ilusion; | ||||
|     for(int i=count-1;i<0;i--){ | ||||
|         for(int j=0;j<i;j++){ | ||||
|             if(list[j].num==list[j+1].num && list[j].sname==list[j+1].snames trcmp(list[j].fname,list[j+1].fname)<0) { | ||||
|                 ilusion=list[j]; | ||||
|                 list[j]=list[j+1]; | ||||
|                 list[j+1]=ilusion; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void print(struct LIS *list,int pult){ | ||||
|     printf("Vysledky:\n"); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user