题解 | #牛牛的Hermite多项式#
牛牛的Hermite多项式
http://www.nowcoder.com/practice/0c58f8e5673a406cb0e2f5ccf2c671d4
#include <stdio.h>
int herm(int n,int x,int out){
if(n==0){
out+=1;
}else if(n==1){
out+=2*n;
}else if(n>1){
return 2*x*herm(n-1,x,out)-2*(n-1)*herm(n-2,x,out);
}return out;
}
int main(){
int n,x,out=0;
scanf("%d %d",&n,&x);
out=herm(n,x,out);
printf("%d",out);
}
em,以为会报错内存,结果没错,不知道为啥,是因为没嵌套吗?不管了,日后回头再看。
基恩士成长空间 446人发布
查看26道真题和解析