This commit is contained in:
Oleksandr Vyshniakov 2025-02-21 13:00:24 +01:00
parent 0ad6253488
commit 7cc282f0c9
2 changed files with 35 additions and 3 deletions

View File

@ -1,6 +1,38 @@
#include <stdio.h>
#define celyhodnoty 50
#define maxcol 50
int main() {
return 0;
}
int results[maxcol];
int count = 0;
int num;
while (count < maxcol && scanf("%d", &num) == 1) {
if (num < 1) {
break;
}
results[count] = num;
count++;
}
if (count == 0) {
printf("Chyba. Malo platnych hodnot.\n");
return 1;
}
for (int i = 0; i < count; i++) {
printf("Sutaziaci c. %d vypil %d poharov.\n",i+1,results[i]);
}
int max_value = results[0];
for (int i = 1; i < count; i++) {
if (results[i] > max_value) {
max_value = results[i];
}
}
for (int i = 0; i < count; i++) {
if (results[i] == max_value) {
printf("Vyherca je sutaziaci %d ktory vypil %d poharov.\n",i+1,results[i]);
}
}
return 0;
}

Binary file not shown.