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 |
小优化一把#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