TOPIC

wa 15% o q pode ser?

Raquel de Sá Silva asked 1 year ago

deu errado, mas todas as saidas estao corretas. alguem pode detectar o erro?

include

int main() { int c,N,re=0; scanf("%d",&N); int m[N];

for(c=0;c<N;c++){ scanf("%d",&m[c]); } if(m[0]<m[1]){ for(c=1;c<N;c++){

         if(c%2!=0){
        if(m[c+1]<m[c])
        re=1;
        }

        if(c%2==0){
        if(m[c+1]>m[c])
        re=1;
        }

} }else if(m[0]>m[1]){ for(c=1;c<N;c++){ if(c%2!=0){ if(m[c+1]>m[c]) re=1; }

        if(c%2==0){
        if(m[c+1]<m[c])
        re=1;
        }
}
}

printf("%d\n",re);

return 0;

}

Remember not post solutions. Your post may be reviewed by our moderators.