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:fangxubz at 2014-04-21 11:32:28 > #include<stdio.h> > int main() > { > int n, i, j; > for(i = 1; i <=10000; i++) > { > int flag = 0; > int sum; > for(j = i - 36; j < i; j++) > { > int h = j; > sum = j; > while(h != 0) > { > sum += h%10; > h /= 10; > } > if(sum == i) > { > flag = 1; > break; > } > } > if(flag == 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