#include<stdio.h>
int main() {
int n,i,a[10];
scanf("%d",&n);
for(i=0;i<=n;i++)
{
scanf("%d",&a[i]);
}
if(a[0]>a[1]&&a[2]>a[1]&&a[2]>a[3]&&a[4]>a[3])
printf("%d",n-2);
else
printf("%d",n);
return 0;
}
int main() {
int n,i,a[10];
scanf("%d",&n);
for(i=0;i<=n;i++)
{
scanf("%d",&a[i]);
}
if(a[0]>a[1]&&a[2]>a[1]&&a[2]>a[3]&&a[4]>a[3])
printf("%d",n-2);
else
printf("%d",n);
return 0;
}
75%
ReplyDeletebro plz check it
ReplyDelete#include
ReplyDeleteint main() {
int n,i;
scanf("%d",&n);
int array[n];
for(i=0;i<n;i++)
scanf("%d",&array[i]);
int count=1;
for(i=0;i<n-1;i++)
{
if(array[i+1]<array[i])/* if(!(array[i+1]<array[i]))
count++; */
continue;
count++;
}
printf("%d",count);
return 0;
}
This comment has been removed by the author.
ReplyDelete