funguje
This commit is contained in:
parent
da4409830f
commit
5ed55cd17a
38
du2/program.c
Normal file
38
du2/program.c
Normal file
@ -0,0 +1,38 @@
|
||||
#include<stdio.h>
|
||||
#include<string.h>
|
||||
#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<VELKOST_POLA; i++){
|
||||
if (pole[i] > max_hodnota){
|
||||
max_hodnota = pole[i];
|
||||
}
|
||||
}
|
||||
printf("%d\n", max_hodnota);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user