39 lines
809 B
C
39 lines
809 B
C
#include<stdio.h>
|
|
|
|
#define FIELD_SIZE 52
|
|
|
|
int main(){
|
|
int field[FIELD_SIZE] = {0};
|
|
int count = 0;
|
|
int max_num = 0;
|
|
int input;
|
|
int winner_index = 0;
|
|
|
|
while (count < FIELD_SIZE) {
|
|
if (scanf("%d", &input) != 1) {
|
|
break;
|
|
}
|
|
if (input < 0) {
|
|
break;
|
|
}
|
|
field[count] = input;
|
|
count++;
|
|
}
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, field[i]);
|
|
if (field[i] > max_num) {
|
|
max_num = field[i];
|
|
winner_index = i;
|
|
}
|
|
}
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
if (field[i] == max_num) {
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",i+1, max_num);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|