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 jean890915 at 2011-10-04 21:13:30 on Problem 1517
#include "iostream"
using namespace std;

long jiechen(int n)
{
	if (n==0)
		return 1;
	else if (n==1)
		return 1;
	else
		return n*jiechen(n-1);
}

int main(void)
{
	int i;
	double sum=0;
	cout<<"n e\n- -----------\n";
	for (i=0;i<10;i++)
	{
		sum += 1.0/jiechen(i);
		cout<<i<<' ';
		if (i<3)
			printf("%.9g\n",sum);
		else
			printf("%.9lf\n",sum);
	}
	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