| ||||||||||
| 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 > /*
> Poj: 1316 Self Numbers
> */
>
> #include <stdio.h>
>
> int main()
> {
> int num[10001];
> int i, j;
> int d;
>
> for(i = 0; i < 10001; i++)
> num[i] = 0;
>
> for(i = 0; i < 10000; i++) {
> j = i;
> d = i;
> while(j) {
> d += j%10;
> j /= 10;
> }
> if(d <= 10000)
> num[d] = 1;
> }
>
> for(i = 0; i < 10001; i++)
> if(num[i] == 0)
> printf("%d\n", i);
>
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator