Aktualizovat „du2/program.c“
This commit is contained in:
parent
84e731e168
commit
5ec42c6cad
@ -1,4 +1,29 @@
|
||||
#include
|
||||
int main(){
|
||||
#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);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user