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-09 13:05:32 +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;
|
2022-03-09 13:05:32 +00:00
|
|
|
//max = results[0];
|
|
|
|
/*if(max < results[i])
|
|
|
|
max = results[i];*/
|
2022-03-09 12:53:51 +00:00
|
|
|
i++;
|
|
|
|
}else{
|
|
|
|
break;
|
|
|
|
}
|
2022-03-09 12:59:22 +00:00
|
|
|
}
|
|
|
|
do{
|
2022-03-09 13:05:32 +00:00
|
|
|
printf("Súťažiaci č. %d vypil %d pohárovav.\n", /*results[a]*/a+1, results[a]);
|
2022-03-09 12:59:22 +00:00
|
|
|
if(a == i - 1){
|
2022-03-09 13:05:32 +00:00
|
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", a+1, results[a]);
|
2022-03-09 12:59:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
a++;
|
|
|
|
}while(a < i);
|
2022-03-08 14:34:11 +00:00
|
|
|
return 0;
|
|
|
|
}
|