cv5
This commit is contained in:
parent
0a1a0045b5
commit
212b8434e1
@ -13,7 +13,12 @@ struct student {
|
|||||||
int compare_students(const void *a, const void *b) {
|
int compare_students(const void *a, const void *b) {
|
||||||
const struct student *student_a = (const struct student *)a;
|
const struct student *student_a = (const struct student *)a;
|
||||||
const struct student *student_b = (const struct student *)b;
|
const struct student *student_b = (const struct student *)b;
|
||||||
return (student_b->votes - student_a->votes);
|
|
||||||
|
if (student_a->votes == student_b->votes) {
|
||||||
|
return strcmp(student_a->name, student_b->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (student_b->votes - student_a->votes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Definícia ukazovateľa na vlastný chybový výstup
|
// Definícia ukazovateľa na vlastný chybový výstup
|
||||||
|
Loading…
Reference in New Issue
Block a user