funguje
This commit is contained in:
parent
db2b3ef0aa
commit
8062bddb66
@ -40,8 +40,8 @@ int main() {
|
|||||||
memset(database, 0, SIZE * sizeof(struct student));
|
memset(database, 0, SIZE * sizeof(struct student));
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
// Zadefinovaný vstup mien a počtu hlasov
|
// Vlastný vstup mien a počtu hlasov
|
||||||
char input[][MAX_NAME_LENGTH + 5] = {
|
char *input[] = {
|
||||||
"2 Bardos Mrtakrys",
|
"2 Bardos Mrtakrys",
|
||||||
"1 Rita Umhi",
|
"1 Rita Umhi",
|
||||||
"1 Prylenn Alak",
|
"1 Prylenn Alak",
|
||||||
@ -78,7 +78,8 @@ int main() {
|
|||||||
// Zoradenie databázy
|
// Zoradenie databázy
|
||||||
qsort(database, size, sizeof(struct student), compare);
|
qsort(database, size, sizeof(struct student), compare);
|
||||||
|
|
||||||
// Výpis databázy
|
// Výpis výsledkov
|
||||||
|
printf("Výsledky:\n");
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
printf("%d %s\n", database[i].votes, database[i].name);
|
printf("%d %s\n", database[i].votes, database[i].name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user