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 125019682 at 2006-04-10 17:58:46 on Problem 1519
#include<iostream>
using namespace std;

void main()
{
	int root, a;

	while ( cin >> a)
	{
		if (a == 0)
			return;
		root = a;
		
		while (root >= 10)
		{
			a = a / 10 + a % 10;
			root = a;
		}
		cout << root << endl;
	}
	
}

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