diff --git a/du2/program.c b/du2/program.c index 65ca495..1464927 100644 --- a/du2/program.c +++ b/du2/program.c @@ -1,4 +1,29 @@ -#include -int main(){ -return 0; +#include +#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; } +