2022-03-08 14:34:11 +00:00
|
|
|
#include <stdio.h>
|
2022-03-09 12:53:51 +00:00
|
|
|
#define VELKOST_POLA 50
|
2022-03-08 14:34:11 +00:00
|
|
|
|
|
|
|
int main(){
|
2022-03-09 12:53:51 +00:00
|
|
|
int results[VELKOST_POLA];
|
2022-03-08 14:34:11 +00:00
|
|
|
int max;
|
2022-03-09 12:53:51 +00:00
|
|
|
//int value = 0;
|
2022-03-08 14:34:11 +00:00
|
|
|
int i = 0;
|
2022-03-09 12:53:51 +00:00
|
|
|
int a = 0;
|
2022-03-08 14:34:11 +00:00
|
|
|
while(1){
|
2022-03-09 12:53:51 +00:00
|
|
|
int value = 0;
|
|
|
|
int r = scanf("%d",&value);
|
|
|
|
if (r == 1){
|
|
|
|
results[i] = value;
|
|
|
|
max = results[0];
|
|
|
|
if(max < results[i])
|
|
|
|
max = results[i];
|
|
|
|
i++;
|
|
|
|
}else{
|
|
|
|
do{
|
|
|
|
printf("Súťažiaci č. %d vypil %d pohárovav.\n", results[a], results[a]);
|
|
|
|
if(a == i - 1){
|
|
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", max, max);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
a++;
|
|
|
|
}while(a < i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-03-08 14:34:11 +00:00
|
|
|
return 0;
|
|
|
|
}
|