Skip to content

Stivenke/project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

这是一个说明文档

#include <stdio.h>
#include <stdlib.h>
int fact(int n);
int factsecond(int n,int rst);
int main()
{
	int tmp=8;
	printf("%d\n",fact(tmp));
	printf("%d\n",factsecond(tmp,1));
	return 0;
}
// 递归
int fact(int n)
{
	int reasult=0;
	if(n<0)
		reasult=0;
	else if(n==0||n==1)
		reasult=1;
	else
		reasult=n*fact(n-1);
	return reasult;
}
// 尾递归
int factsecond(int n,int rst)
{
	int reasult=0;
	if(n<0)
		reasult=0;
	else if(n==0||n==1)
		reasult=rst;
	else
		reasult=factsecond(n-1,n*rst);
	return reasult;
}

$$ F/A=\left{\frac{(1+i)^n-1}i\right} $$

$$ \sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6} $$

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published