33 lines
589 B
C
33 lines
589 B
C
#include <stdio.h>
|
|
#define VELKOST_POLA 50
|
|
|
|
int main(){
|
|
int results[VELKOST_POLA];
|
|
//int max;
|
|
//int value = 0;
|
|
int i = 0;
|
|
int a = 0;
|
|
while(1){
|
|
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{
|
|
break;
|
|
}
|
|
}
|
|
do{
|
|
printf("Súťažiaci č. %d vypil %d pohárovav.\n", /*results[a]*/a+1, results[a]);
|
|
if(a == i - 1){
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", a+1, results[a]);
|
|
break;
|
|
}
|
|
a++;
|
|
}while(a < i);
|
|
return 0;
|
|
}
|