ds
This commit is contained in:
		
							parent
							
								
									d65bda55da
								
							
						
					
					
						commit
						ecf4aa94b8
					
				| @ -65,6 +65,12 @@ int find_student(struct student* students,int size, const char* name){ | |||||||
| int compare(const void* p1, const void* p2){ | int compare(const void* p1, const void* p2){ | ||||||
|     struct student* s1 = (struct student*)p1; |     struct student* s1 = (struct student*)p1; | ||||||
|     struct student* s2 = (struct student*)p2; |     struct student* s2 = (struct student*)p2; | ||||||
|  |      | ||||||
|  |     int res=(s2->votes)-(s1->votes); | ||||||
|  |     for(int idx=0; res==0||(s1->name[idx])!='\0';idx++){ | ||||||
|  |         res=(int)(s2->name[idx])-(int)(s1->votes[idx]); | ||||||
|  |     } | ||||||
|  |          | ||||||
|     return (s2->votes)-(s1->votes); |     return (s2->votes)-(s1->votes); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user