pvjc20/du2/program.c

30 lines
490 B
C

#include <stdio.h>
#define VELKOST_POLA 12
int main()
{
int value = 0;
int pole[VELKOST_POLA] = {0,0,0,0};
int r = 0;
int i = 0;
int max_hodnota = pole[0];
while (r = scanf("%d",&value)){
pole[i] = value;
i++;
}
int len = (sizeof(pole)/sizeof(*pole));
for(i = 0; i < len; i++){
if(pole[i] > max_hodnota){
max_hodnota = pole[i];
}
}
printf("%d", max_hodnota);
return 0;
}