Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这个是我的代码,结果跟题目中列出来的都一样,为什么wrong answer?请帮忙看下啊!谢谢!#include <stdio.h> #include <string.h> #define lenth 10003 int selfnum[lenth]={0}; void done(); int main() { done(); for(int i=1;i<10000;i++) { if(selfnum[i]==0) printf("%d\n",i); else continue; } getchar(); return 0; } void done() { int sum,yu; selfnum[0]=1; selfnum[1]=0; selfnum[2]=1; for(int i=2;i<lenth;i++) { yu=i; sum=yu; while(yu) { sum+=(yu%10); yu/=10; } selfnum[sum]=1; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator