首页 > 其他 > 详细

n阶多项式递归

时间:2015-01-09 20:41:58      阅读:287      评论:0      收藏:0      [点我收藏+]

#include <stdio.h>
float p(int n,float x)
{
if(n==0)
return (1);
else if(n==1)
return (x);
else
return (((2*n-1)*x-p((n-1),x)-(n-1)*p((n-2),x))/n);

}
int main()
{
float x;
int n;
printf("please input n x:");
scanf("%d%f",&n,&x);
printf("%f",p(n,x));
return 0;

}

n阶多项式递归

原文:http://www.cnblogs.com/SSYYGAM/p/4214017.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!