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

大家帮我看一下1003题。我写的程序为什么不成功。希望指出错误

Posted by 382784268 at 2008-09-16 13:32:09 on Problem 1003
//#include "stdafx.h"
#include<iostream>
using namespace std;

int main(int argc, char* argv[])
{
	double r;
    double n,sum=0;
	cin>>r;
	while(r!=0.00&&r>=0.01&&r<=5.20)
	{
		for(n=2;sum<r;n++)
			sum=sum+1/n;
	cout<<(n-2)<<endl;
	cin>>r;
	}
	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