码迷,mamicode.com
首页 > 编程语言 > 详细

【C语言】 厄密多项式(递归函数)

时间:2015-05-10 17:25:14      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

所以他的递归函数为:

<span style="font-size:18px;">#include<stdio.h>
int hermite(int n,int x)
{
	if (n<0)
		return 1;
    if (n=1)
		return 2*x;
    if (n>2)
		return 2*(hermite(n-1,x))-2*(n-1)*(hermite(n-2,x));

}
int main()
{
	hermite(1,2);
	printf("%d\n",hermite(1,2));
	return 0;
}</span>

运行结果为:

技术分享

 


 

 

【C语言】 厄密多项式(递归函数)

标签:

原文地址:http://blog.csdn.net/liuxiaoqian_/article/details/45621371

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!