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 |
救救我!wa#include<iostream.h> void main() { int a[2000]; int i,j=1,b; a[0]=1; for(i=1;i<2000;i++) { if((j%2==0)||(j%3==0)||(j%5==0)) a[i]=j; else i--; j++; } //for(i=0;i<1500;i++) // cout<<" "<<a[i]; while(1) { cin>>b; if(b==0) break; else cout<<a[b-1]<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator