2023-03-02 14:33:37 +00:00
|
|
|
#include <stdio.h>
|
2023-03-02 14:49:49 +00:00
|
|
|
#include <stdlib.h>
|
2023-03-04 12:00:52 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2023-03-02 14:33:37 +00:00
|
|
|
#define VELKOST_POLA 52
|
2023-03-04 12:00:52 +00:00
|
|
|
|
2023-03-02 14:33:37 +00:00
|
|
|
int main(){
|
2023-03-04 12:00:52 +00:00
|
|
|
int i = 0;
|
2023-03-02 14:33:37 +00:00
|
|
|
int pole[VELKOST_POLA];
|
2023-03-04 12:00:52 +00:00
|
|
|
memset(pole, 0, VELKOST_POLA * sizeof(int));
|
|
|
|
int max_hodnota = 0;
|
2023-03-04 11:40:50 +00:00
|
|
|
int max_hrac = 0;
|
2023-03-04 12:00:52 +00:00
|
|
|
int value = 0;
|
|
|
|
int r = 0;
|
|
|
|
|
|
|
|
while(i < VELKOST_POLA){
|
|
|
|
value = 0;
|
|
|
|
r = scanf("%d", &value);
|
|
|
|
pole[i] = value;
|
2023-03-04 11:52:13 +00:00
|
|
|
|
2023-03-04 12:00:52 +00:00
|
|
|
if(r == 1){
|
|
|
|
i++;
|
|
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i, value);
|
2023-03-04 11:52:13 +00:00
|
|
|
|
2023-03-04 12:00:52 +00:00
|
|
|
if(value > max_hodnota){
|
|
|
|
max_hodnota = value;
|
|
|
|
max_hrac = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", max_hrac, max_hodnota);
|
2023-03-04 10:37:00 +00:00
|
|
|
}
|