Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7abda62

Browse files
authored
Update 计算厄密多项式.c
1 parentc2f51f9 commit7abda62

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
#
1+
#include<stdio.h>
2+
3+
/**
4+
* 计算 Hermite polynomial 的值
5+
*
6+
* 输入:
7+
* n, x:用于标识值
8+
*
9+
* 输出:
10+
* polynomial的值(返回值)
11+
**/
12+
13+
inthermite(intn,intx )
14+
{
15+
// 处理不需要递归的特殊情况。
16+
if(n <=0 )
17+
return1;
18+
if(n==1 )
19+
return2*x;
20+
21+
// 否则,递归地计算结果值。
22+
return2*x*hermite(n-l,x )-2* (n-1 )*hermite (n-2,x );
23+
}
24+
25+
intmain()
26+
{
27+
printf("%d\n",hermite(3,2));
28+
29+
return0;
30+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp