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 |
Re:超级水题,超级代码In Reply To:超级水题,超级代码 Posted by:whus2010301500230 at 2011-10-28 23:26:14 #include<stdio.h> int main() { int i,num,sum,use[10001]={0}; for(i=1;i<=10000;i++) { if(use[i]==0) printf("%d\n",i); num=i; sum=num; while(num) { sum+=num%10; num/=10; } if(sum<=10000) use[sum]=1; } return 0; } =.=,本来准备用这个打表的说……结果这样就过了…… Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator