|
|
back to boardwhat is wrong? Posted by Ashot 1 May 2008 12:54 please say what is wrong #include <iostream.h> main() { int n,a,b,c,d,e,f; cin>>n; f=n%10; e=(n/10)%10; d=(n/100)%10; c=(n/1000)%10; b=(n/10000)%10; a=(n/100000)%10; cout<<a<<endl; cout<<b<<endl; cout<<c<<endl; cout<<d<<endl; cout<<e<<endl; cout<<f<<endl; if((a+b+c)-(d+f+e)==1 || ((a+b+c)-(d+f+e)==-1)) cout<<"yes"; else cout<<"no"; return 0; } Edited by author 01.05.2008 12:57 Re: what is wrong? try test 123160 and 889789 You don't need to output a,b,c..., only print Yes or No. Edited by author 01.05.2008 13:28 |
|
|