Update a4/program.c

This commit is contained in:
Yurii Yakovenko 2024-11-19 22:30:08 +00:00
parent f0d0df803f
commit 68212b6d24

View File

@ -13,10 +13,23 @@ int main()
}while(1); }while(1);
for(int j=0; j<i; j++) int kupa=1;
int n=i;
for(int i=0; i<n; i++)
{ {
printf("%d ", a[j]); 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:");
else
printf("Nie je kopa.");
return 0; return 0;
} }