From 8062bddb66ab05697f5b6b881eab92c8bf540cbe Mon Sep 17 00:00:00 2001 From: st529yr Date: Wed, 20 Mar 2024 16:34:15 +0100 Subject: [PATCH] funguje --- cv5/program.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index 5f881fc..8322d7e 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -40,8 +40,8 @@ int main() { memset(database, 0, SIZE * sizeof(struct student)); int size = 0; - // Zadefinovaný vstup mien a počtu hlasov - char input[][MAX_NAME_LENGTH + 5] = { + // Vlastný vstup mien a počtu hlasov + char *input[] = { "2 Bardos Mrtakrys", "1 Rita Umhi", "1 Prylenn Alak", @@ -78,7 +78,8 @@ int main() { // Zoradenie databázy 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++) { printf("%d %s\n", database[i].votes, database[i].name); }