39 lines
552 B
C
39 lines
552 B
C
#include <stdio.h>
|
|
///
|
|
int main()
|
|
{
|
|
int a[1000], i=0;
|
|
|
|
do
|
|
{
|
|
if(scanf("%d", &a[i])!=1)
|
|
break;
|
|
else
|
|
i++;
|
|
|
|
}while(1);
|
|
|
|
int kupa=1;
|
|
int n=i;
|
|
|
|
for(int i=0; i<n; i++)
|
|
{
|
|
if(2*i+1<n && a[i]>a[2*i+1]||
|
|
2*i+2<n && a[i]>a[2*i+2])
|
|
{
|
|
kupa =0;
|
|
break;
|
|
}
|
|
}
|
|
if(kupa)
|
|
{
|
|
printf("Je to taka kopa:");
|
|
printf("%d", a[0]);
|
|
}
|
|
else
|
|
printf("Nie je kopa.");
|
|
|
|
|
|
return 0;
|
|
}
|