标签:c
n <= 0 : 1
Hn(x) = n = 1 : 2x
n >= 2 : 2xHn-1(x) - 2(n -1)Hn-2(x)
#include<stdio.h> int hermite(int n, int x) { if(n <= 0) return 1; else if(1 == n) return 2*x; else return 2 * x * hermite(n-1, x) - 2 * (n-1) * hermite(n-2, x); } int main() { int h = hermite(1,2); printf("%d\n",h); return 0; }
标签:c
原文地址:http://blog.csdn.net/cherry_ermao/article/details/44172241