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

Re:结果都对,居然会WA,想不明白。。。。

Posted by hotkaikai at 2009-06-15 14:02:42 on Problem 1316
In Reply To:Re:结果都对,居然会WA,想不明白。。。。 Posted by:chenyukang at 2009-06-02 22:34:47
> 结果对吗? 。。。晕。。
我测试了一下: 结果不对,应为你的t[]数组没初始化,有些数可能就是0.
#include<iostream>
using namespace std;
> int main()
> {
> 	int i,t[10050];
>       for(i=1;i<10000;i++) t[i]=1;
> 	for(i=1;i<10000;i++)
> 		t[i+i/1000+(i/100)%10+(i/10)%10+i%10] = 0;
> 	for(i=1;i<10000;i++)
> 		if(t[i]!=0) printf("%d\n",i);
> 	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