usaa24/a4/program.c

36 lines
495 B
C
Raw Normal View History

2024-11-19 22:18:54 +00:00
#include <stdio.h>
int main()
{
int a[1000], i=0;
do
{
if(scanf("%d", &a[i])!=1)
break;
else
i++;
}while(1);
2024-11-19 22:30:08 +00:00
int kupa=1;
int n=i;
for(int i=0; i<n; i++)
2024-11-19 22:18:54 +00:00
{
2024-11-19 22:30:08 +00:00
if(2*i+1<n && a[i]>a[2*i+1]||
2*i+2<n && a[i]<a[2*i+2])
{
kupa =0;
break;
}
2024-11-19 22:18:54 +00:00
}
2024-11-19 22:30:08 +00:00
if(kupa)
printf("Je to taka kopa:");
else
printf("Nie je kopa.");
2024-11-19 22:18:54 +00:00
return 0;
}