From 198acd7247d1f513c16aff0ba72f63b45e25646c Mon Sep 17 00:00:00 2001 From: st529yr Date: Wed, 20 Mar 2024 17:58:22 +0100 Subject: [PATCH] oooodchod --- cv5/program.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cv5/program.c b/cv5/program.c index d0bc920..27b9cf1 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -48,6 +48,13 @@ int main() { printf("%d %s\n", database[i].votes, database[i].name); } + // Výpočet a výpis celkového počtu hlasov + int total_votes = 0; + for (int i = 0; i < size; i++) { + total_votes += database[i].votes; + } + printf("Celkovy pocet ziskanych hlasov: %d\n", total_votes); + return 0; }