题解 | #牛牛的Hermite多项式#
牛牛的Hermite多项式
https://www.nowcoder.com/practice/0c58f8e5673a406cb0e2f5ccf2c671d4
#include <math.h>
#include <stdio.h>
int herm(int n,int x)
{
if(n==0) return 1;
if(n==1) return 2*n;
if(n>1)
{
return 2*x*herm(n-1,x)-2*(n-1)*herm(n-2,x);
}
return 0;
}
int main() {
int n,x=0;
scanf("%d %d",&n,&x);
printf("%d",herm(n,x));
return 0;
}
