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

Problems1405 为什么wa,都用手算了

Posted by xiao_hao at 2006-01-13 15:17:56
#include<iostream>
using namespace std;

int main()
{
	int N,i,j;
	double a=0;
	cin>>N;
	for(i=1;i<18;i++)
	{
		a=0;
		for(j=i;j<(i+N);j++)
		{
			a+=1.0/(double)j;
		}
		if(a<1)
			break;
	}
	for(j=0;j<N;j++)
		cout<<i++<<endl;
	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