diff --git a/du1/program.c b/du1/program.c index a1f4a8a..00b5972 100644 --- a/du1/program.c +++ b/du1/program.c @@ -1 +1,47 @@ -jfjfj + + +Prejsť na obsah +Používanie služby Gmail s čítačkami obrazovky +Konverzácie +Využívate 105,07 GB z 200 GB +Zmluvné podmienky · Ochrana súkromia · Pravidlá programu +Posledná aktivita účtu pred 2 minútami +Podrobnosti +#include +#include +#include + +#define MAX_COUNT 50 + +int main() { + int results[MAX_COUNT] = {0}; + int max_value = 0; + int value_count = 0; + + for (int i = 0; i < MAX_COUNT; i++) { + int r = scanf("%d", &results[i]); + if (r == 1) { + value_count++; + if (results[i] > max_value) { + max_value = results[i]; + } + } else { + break; + } + } + + if (value_count == 0) { + printf("Žiadne hodnoty neboli načítané.\n"); + return 1; + } + + printf("Maximálna hodnota bola %d.\n", max_value); + + for (int i = 0; i < value_count; i++) { + if (results[i] == max_value) { + printf("Súťažiaci číslo %d dosiahol maximálnu hodnotu.\n", i + 1); + } + } + + return 0; +}