满意答案
joe19908088
2013.06.13
采纳率:48% 等级:12
已帮助:5242人
#include
#include
float myfunction(int n,int x)
{
if (0 == n)
{
return 1;
}
else if (1 == n)
{
return x;
}
else
{
return ((2 * n - 1) * x - myfunction(n - 1 , x) - (n - 1) * myfunction(n - 2, x)) / n;
}
}
int main(int argc, char *argv[])
{
int n,x;
float result;
printf("please inputa n,x:");
scanf("%d,%d",&n,&x);
result = myfunction(n,x);
printf("the result is : %f\n",result);
system("pause");
return 0;
}
113分享举报