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 |
郁闷!!我也WA了#include <iostream> using namespace std; int main() { long long a,b,carry=0; while(cin>>a>>b&&(a&&b)) { carry=0; while(a&&b) { if(a%10+b%10>9) { carry++; a+=10; } a/=10;b/=10; } if(!carry) { cout<<"No carry operation."<<endl; } else if(carry==1) cout<<"1 carry operation."<<endl; else cout<<carry<<" carry operations."<<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