TOPIC

Why I get 10% wrong

Istileo asked 4 years ago

include

using namespace std; int main() { int i,n,k=0,m=0,l; for(i=0;i<5;i++){ cin>>n; if(n<0){ n=-1*n; if(n%2==0){ k++; } } else if(n>0){ if(n%2==0){ m++; } }

}
l=k+m;
cout<<l<<" valores pares"<<endl;

return 0;

}

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

  • alexis__t replied 4 years ago

    Use Ctrl + Alt + C to paste the code.