TOPIC

Why I get 10% wrong

Isti leo asked 1 year 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.

  • Aléxis Toigo replied 1 year ago

    Use Ctrl + Alt + C to paste the code.