题解 | #牛牛的Hermite多项式#
牛牛的Hermite多项式
https://www.nowcoder.com/practice/0c58f8e5673a406cb0e2f5ccf2c671d4
#include <stdio.h> int Hermite(int n, int x) { int ret = 0; if (n == 0) { ret = 1; } else if (n == 1) { ret = 2 * n; } else if (n > 1) { ret = 2 * x * Hermite(n - 1, x) - 2 * (n - 1) * Hermite(n - 2, x); } return ret; } int main() { int n, x = 0; scanf("%d %d", &n, &x); printf("%d", Hermite(n, x)); return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目