Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么总是WA啊,哪里错了?

Posted by BugKiller at 2008-03-17 22:12:42 on Problem 1338
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator