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 <stdio.h> int main(){ int ugly[1700]={0}; int n,index=1,temp; ugly[1]=1; for(scanf("%d",&n);n>0;scanf("%d",&n)){ temp=ugly[index]+1; while(index<n){ if(temp%2==0||temp%3==0||temp%5==0){ index++; ugly[index]=temp; } temp++; } printf("%d\n",ugly[n]); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator