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

Re:SOS "Runtime Error"

Posted by ywj0071 at 2006-03-01 12:59:54 on Problem 1338
In Reply To:SOS "Runtime Error" Posted by:ywj0071 at 2006-03-01 00:37:34
#include<iostream>
#define MAX 100
using namespace std;
void main(){
	int ugly_numbers[MAX],c_in[10],n=0;
	ugly_numbers[0]=1;
	for(int i=1;i<=MAX; i++){  
		if(i%2==0||i%3==0||i%5==0) ugly_numbers[++n]=i;
		else continue;
	}
	cin>>c_in[0];
	n=0;
	while(c_in[n++]!=0)	cin>>c_in[n];
	for(i=0;i<n-1;i++) cout<<ugly_numbers[c_in[i]-1]<<endl;
}
就是这个,请高手指点,谢谢了!

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