Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
运行正常,但是答案错误,怎么办 by glut#include<iostream> using namespace std; int main() { int x,y; while(cin>>x>>y&&x&y) { int count(0),sum(0); while(x&&y) { sum+=x%10+y%10; if(sum>9) { count++; sum=1; } else sum=0; x/=10; y/=10; } if(count) cout<<count<<" carry operations."<<endl; else cout<<"No carry operation."<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator