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

这个题Special Judged

Posted by pb03005073 at 2007-01-02 16:59:53 on Problem 1517
#include <iostream>
#include <cmath>
using namespace std;

double solver(double i)
{
	double ans=1;
	if(i==0)
		return 1;
	else
	{
		for(int j=1;j<=i;j++)
			ans*=j;
	}	
	return 1.0/ans;
}
void main()
{
	double sum=0;
	cout<<"n e"<<endl;
	cout<<"- -----------"<<endl;
	cout.setf(ios::fixed);
	cout.setf(ios::showpoint);
	cout.precision(9);
	for(double i=0;i<10;i++)
	{
		sum=0;
		for(double j=0;j<=i;j++)
			sum+=solver(j);
		cout<<int(i)<<" "<<sum<<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