2022-03-09 07:57:33 +00:00
|
|
|
#include <stdio.h>
|
2022-03-10 18:33:38 +00:00
|
|
|
#include <stdlib.h>
|
2022-03-09 07:57:33 +00:00
|
|
|
#define VELKOST_POLA 52
|
|
|
|
|
2022-03-10 19:23:56 +00:00
|
|
|
struct Winner{
|
|
|
|
int drinks,position;
|
|
|
|
};
|
|
|
|
|
2022-03-09 07:58:54 +00:00
|
|
|
int main(){
|
2022-03-10 19:23:56 +00:00
|
|
|
int drinks_counter[VELKOST_POLA];
|
|
|
|
int i=0;
|
|
|
|
while(i<VELKOST_POLA){
|
2022-03-10 19:30:17 +00:00
|
|
|
scanf("%d",&drinks_counter[i]);
|
|
|
|
if(drinks_counter[i]<1){
|
2022-03-10 19:23:56 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
struct Winner max={0,0};
|
|
|
|
for(int j=0;j<i;j++){
|
2022-03-10 19:31:22 +00:00
|
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n",j+1,drinks_counter[j]);
|
2022-03-10 19:23:56 +00:00
|
|
|
if(drinks_counter[j]>max.drinks){
|
|
|
|
max.drinks=drinks_counter[j];
|
2022-03-10 19:30:17 +00:00
|
|
|
max.position=j+1;
|
2022-03-09 08:26:32 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-10 19:23:56 +00:00
|
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n",max.position,max.drinks);
|
2022-03-10 11:23:37 +00:00
|
|
|
return 0;
|
2022-03-05 16:27:11 +00:00
|
|
|
}
|