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<iostream> using namespace std; int main() { int i,k,temp,b[20000];//最初开了10000 for(i=1;i<=10000;i++) b[i]=i; for(i=1;i<=10000;i++){ temp=k=i; while(k){ temp+=k%10; k=k/10; } b[temp]=0;//temp大于10000 } for(i=1;i<=10000;i++) if(b[i]) cout<<b[i]<<endl; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator