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

高手麻烦看下,为什么不过阿~~~~

Posted by tommysunyao at 2009-03-12 21:58:37 on Problem 1607
#include <iostream>
using namespace std;
int main()
{
	int n;
	double sum=0;
	double i=1.0;
	cout<<"Cards   Overhang"<<endl;
	while( scanf("%d",&n)!=EOF && n>=0 && n<=99999 )
	{
		while(i<=n)
		{
			sum=sum+1/(2.0*i);
			i++;
		}
		printf("%5d      %.3f\n",n,sum);
		i=1.0;
		sum=0;
	}
	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