int dempt (int a[], int n)
{
int dem=0;
if (n>1) dem = a[n-1]>a[n-2];
for (int i=1; i<n-1; i++)
if (a[i]>a[i-1] && a[i]>a[i+1])
dem++;
return dem;
}
Last modified on September 21st, 2023 at 11:10 pm
Nam Le
lequocnam
0 responds