From 8ebdcaf444453cc937bb0ae2391343328ac3110b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ut=C4=BE=C3=A1k?= Date: Thu, 29 Feb 2024 10:48:22 +0000 Subject: [PATCH] variables --- cv2/program.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cv2/program.c b/cv2/program.c index b230ab1..ee7fb5d 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -27,23 +27,23 @@ int main() { printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, pole[i]); } - int maxPoharov = pole[0]; + int pohare = pole[0]; int pocetVyhercov = 1; for (int i = 1; i < pocetCisel; i++) { - if (pole[i] > maxPoharov) { - maxPoharov = pole[i]; + if (pole[i] > pohare) { + pohare = pole[i]; pocetVyhercov = 1; - } else if (pole[i] == maxPoharov) { + } else if (pole[i] == pohare) { pocetVyhercov++; } } for (int i = 0; i < pocetCisel; i++) { - if (pole[i] == maxPoharov) { + if (pole[i] == pohare) { printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i + 1, pole[i]); } } return 0; -} +} \ No newline at end of file