2022-03-10 17:15:54 +00:00
|
|
|
#include<stdio.h>
|
|
|
|
#include<string.h>
|
|
|
|
#define VELKOST_POLA 12
|
|
|
|
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
|
|
|
|
int value = 0;
|
|
|
|
|
|
|
|
int pole[VELKOST_POLA];
|
|
|
|
memset(pole,0,VELKOST_POLA*(sizeof(int)));
|
|
|
|
|
2022-03-10 17:24:43 +00:00
|
|
|
|
|
|
|
int max_hodnota=0;
|
2022-03-10 17:15:54 +00:00
|
|
|
int idx=0;
|
|
|
|
while (1){
|
|
|
|
int r=scanf("%d",&value);
|
|
|
|
if(r!=1||idx==VELKOST_POLA){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pole[idx]=value;
|
2022-03-10 17:24:43 +00:00
|
|
|
if (pole[idx] > max_hodnota){
|
2022-03-10 17:26:26 +00:00
|
|
|
max_hodnota = pole[idx];
|
2022-03-10 17:24:43 +00:00
|
|
|
}
|
2022-03-10 17:15:54 +00:00
|
|
|
idx++;
|
|
|
|
value++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (value==0){
|
|
|
|
printf("Error\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-03-10 17:24:43 +00:00
|
|
|
for(int i=0; i<VELKOST_POLA;i++){
|
2022-03-10 17:28:41 +00:00
|
|
|
if(pole[i]>0){
|
|
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i, pole[i]);
|
|
|
|
}
|
2022-03-10 17:15:54 +00:00
|
|
|
}
|
2022-03-10 17:24:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
//printf("%d\n", max_hodnota);
|
2022-03-10 17:15:54 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|