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 1006840214 at 2011-09-18 22:12:11 on Problem 1316
#include <iostream>
using namespace std;
int qiu(int k)
{	
	int sum=0;
	while(k!=0)
	{
		sum+=k%10;
		k=k/10;
	}
	return sum;
}
int main(void)
{
	int i=1;
	for(;i<10000;i++)
	{
		int j=1,sum=0;
		for(;j<i;j++)
		{
			sum=j;
			sum+=qiu(j);
			if(sum==i)
				break;
		}
		if(sum==i)
			continue;
		cout<<i<<endl;
	}
	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