码迷,mamicode.com
首页 > 其他好文 > 详细

Hermite多项式

时间:2017-08-09 19:07:18      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:span   alt   class   stdio.h   正整数   print   gif   iostream   include   

Hermite多项式


链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1165

【题目描述】

用递归的方法求Hermite多项式的值

技术分享

对给定的x和正整数n,求多项式的值。

【输入】

给定的n和正整数x。

【输出】

多项式的值。

【输入样例】

1 2

【输出样例】

4.00
#include <iostream>
#include<stdio.h>
using namespace std;


double h(int n,int x){
    if(n==0) return 1;
    if(n==1)return 2.0*x;
    return 1.0*(2*x*h(n-1,x)-2*(n-1)*h(n-2,x));
}
int main(){
    
    int x,n;
    cin>>n>>x;
    printf("%.2f",h(n,x));
    
}

 

Hermite多项式

标签:span   alt   class   stdio.h   正整数   print   gif   iostream   include   

原文地址:http://www.cnblogs.com/EdSheeran/p/7327041.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!