|
|
back to boardWhy C++ help Posted by Barbs 1 Feb 2015 21:41 include <iostream> using namespace std; int main() { int N=0,a=0,b=0; cin>>N; a=(N/100000)+(N/10000-N/100000*10)+(N/1000-N/10000*10); b=(N/100-N/1000*10)+(N/10-N/100*10)+(N-N/10*10); if(a-1==b){ cout << "YES\n"; } else { cout << "NO\n"; } return 0; } |
|
|