Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

帮我看一下

Posted by lizhi at 2005-08-25 11:59:06 on Problem 2562
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator