| ||||||||||
| 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 | |||||||||
帮我看一下#include<iostream.h>
int main()
{
int count;
long first,second;
while(cin>>first>>second)
{
count=0;
if(first==0&&second==0) break;
for(;first>0||second>0;)
{
if(first%10+second%10>=10)
{
count++;
first+=10;
}
first/=10;
second/=10;
}
if(count==0) cout<<"No carry operation.\n";
else if(count==1)
cout<<count
<<" carry operation.\n";
else cout<<count
<<" carry operations.\n";
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator