From 2d4ddd79ccb0f16777dededab0df4082d6bce4a3 Mon Sep 17 00:00:00 2001 From: st529yr Date: Wed, 20 Mar 2024 18:06:29 +0100 Subject: [PATCH] oooodchod --- cv5/program.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index 84e90f8..b406480 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -28,16 +28,17 @@ int compare_students(const void* a, const void* b) { int main() { // Databáza študentov s preddefinovanými hodnotami struct Student students[MAX_STUDENTS] = { + {"Terian Dis", 10}, // Terian Dis má 10 hlasov {"Bardos Mrtakrys", 2}, {"Rita Umhi", 1}, {"Prylenn Alak", 1}, - {"Lak'hi Elavorg", 10}, + {"Lak'hi Elavorg", 9}, // Lak'hi Elavorg má menej ako 10 hlasov {"Prylenn Alak", 3}, {"Prylenn Alak", 3}, {"Prylenn Alak", 3}, {"Rita Umhi", 1} }; - int num_students = 8; // Počet študentov v databáze + int num_students = 9; // Počet študentov v databáze // Zoradenie študentov podľa počtu hlasov a mena qsort(students, num_students, sizeof(struct Student), compare_students);