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