#include <conio.h>
#include <stdio.h>
int main()
{
int A[100],i,n,flag=1;
printf("\n Nhap n=");
scanf("%d",&n);
printf("\n Nhap mang: \n");
for(i=0;i<n;i++)
{
printf("A[%d]=",i);
scanf("%d",&A[i]);
}
for(i=0;i<n-1;i++)
{
if(A[i+1]<A[i])
{
flag=0;
printf("\n Day ko la day tang dan, phan tu ko tang dau tien la: %d \n",A[i+1]);
break;
}
}
if(flag==1)
printf("\n Day la day tang dan \n");
getch();
}
Last modified on December 22nd, 2021 at 12:39 am
Nam Le
lequocnam
0 responds