diff --git a/du2/program.c b/du2/program.c new file mode 100644 index 0000000..6a6418d --- /dev/null +++ b/du2/program.c @@ -0,0 +1,38 @@ +#include +#include +#define VELKOST_POLA 12 + + +int main(){ + + int value = 0; + + int pole[VELKOST_POLA]; + memset(pole,0,VELKOST_POLA*(sizeof(int))); + + int idx=0; + while (1){ + int r=scanf("%d",&value); + if(r!=1||idx==VELKOST_POLA){ + break; + } + pole[idx]=value; + idx++; + value++; + } + + if (value==0){ + printf("Error\n"); + return 0; + } + + int max_hodnota=0; + for(int i=0; i max_hodnota){ + max_hodnota = pole[i]; + } + } + printf("%d\n", max_hodnota); + + return 0; +}