Aktualizovat „du2/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-03-02 13:52:42 +00:00
parent 84e731e168
commit 5ec42c6cad

View File

@ -1,4 +1,29 @@
#include #include <stdio.h>
int main(){ #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; return 0;
} }