commit 38407413992369fca05a1175ed52695ae63d6a45 Author: Igor Kavečanský Date: Fri Mar 29 11:54:29 2019 +0100 1 diff --git a/anketa.c b/anketa.c new file mode 100644 index 0000000..2ea5d4e --- /dev/null +++ b/anketa.c @@ -0,0 +1,78 @@ +#include "anketa.h" +#include +#include +#include + +int count_students(struct student* students){ + int i; + for(i=0; ivotes==stud2->votes){ + return 0; + }else if(stud1->votesvotes){ + return 1; + } + return -1; +} + +void sort_students(struct student* students){ + qsort(students,count_students(students),sizeof(struct student),compare); +} + +void print_students(struct student* students){ + for(int i=0;i