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 |
why WA#include <iostream.h> #include <memory.h> #include <math.h> int number[10001]; int size (int a) { int s=int (log(a)/log(10))+1; int g=0; int result=0; for (g=0;g<s;g++) { result=result+a%10; a=a/10; } return result; } int main() { int a=1; memset (number,0,sizeof (number)); while (a<=10000) { number[a+size(a)]=1; a++; } for (a=1;a<=10000;a++) { if (number[a]==0) cout<<a<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator