《C和指針》第7章第1道編程題:
Hermite Polynomials(厄密多項式)是這樣定義的:

例如,H3(2)的值是40。請編寫一個遞歸函數,計算Hn(x)的值。函數原型為:
int hermite( int n, int x );
1 /*
2 ** 計算Hermite Polynomials(厄密多項式)的值
3 */
4
5 #include <stdio.h>
6
7 int hermite( int n, int x );
8
9 int
10 main()
11 {
12 int n, x;
13 scanf( "%d%d", &n, &x );
14 printf( "%d", hermite( n, x ) );
15 return 0;
16 }
17
18 /*
19 ** 計算厄密多項式的值,遞歸函數版本
20 */
21 int
22 hermite( int n, int x )
23 {
24 int result;
25
26 if( n <= 0 )
27 result = 1;
28 else {
29 if( n == 1 )
30 result = 2 * x;
31 else
32 result = 2 * x * hermite( n - 1, x )
33 - 2 * ( n - 1 ) * hermite( n - 2, x );
34 }
35 return result;
36 }