|
|
back to boardwhy is my code wrong?????????? Posted by milad 8 Jul 2011 21:11 #include <iostream> using namespace std; int main() { int a,m,n; cin>>n>>m; a=(n*m)&2; if(a!=0) cout<<"[second]=:]"<<endl; else if(a==0) cout<<"[:=[first]"<<endl; return 0; } Edited by author 08.07.2011 21:11 Edited by author 08.07.2011 21:11 Re: why is my code wrong?????????? The error is in line: > a=(n*m)&2; Replace it with this: > a=(n*m)%2; Or this: > a=(n*m)&1; |
|
|