pvjc20/du2/program.c

35 lines
555 B
C
Raw Normal View History

2020-03-02 13:52:42 +00:00
#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);
2020-03-02 13:53:18 +00:00
free(max_hodnota);
free(i);
free(r);
free(value);
2020-03-02 13:52:42 +00:00
return 0;
2020-02-26 10:03:57 +00:00
}
2020-03-02 13:52:42 +00:00