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 jiaolong_fly at 2011-03-30 19:20:36 on Problem 1517
#include<stdio.h>

double fac(int n)
{
       float f;
	   if(n==0||n==1)
		   f=1;
	   else if(n>1)
	   {
           f=fac(n-1)*n;
	   }

	   return f;
}

void main()
{

	double sum=0;
	double a;
	int i;

	printf("n e\n");
	printf("- -----------\n");
	
	for(i=0;i<10;i++)
	{ 
		a = 1/fac(i);
		sum = a +sum;

		printf("%d %.9f\n",i,sum);
           
	}


}

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