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 julyflame at 2009-03-03 20:13:01 on Problem 1316 and last updated at 2009-03-03 20:17:11
#include<iostream>
using namespace std;
int main()
{
	int i,k,temp,b[20000];//最初开了10000
	for(i=1;i<=10000;i++)
		b[i]=i;
	for(i=1;i<=10000;i++){
		temp=k=i;
		while(k){
			temp+=k%10;
			k=k/10;	
		}
		b[temp]=0;//temp大于10000
	}
	for(i=1;i<=10000;i++)
		if(b[i])
			cout<<b[i]<<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