皮卡丘


私信TA

用户名:glisten

访问量:2542

签 名:

等  级
排  名 11157
经  验 1004
参赛次数 0
文章发表 5
年  龄 0
在职情况 学生
学  校 河南农业大学
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<stdio.h>

#include<math.h>

double fact(double n)

{double a=1;

for(int i=1;i<=n;i++)

a=a*i;

return(a);

}

double mypow(double x,double n)

{double s=0;

for(int i=1;i<=n;i++)

s=s+pow(-1,i+1)*pow(x,i)/fact(i);

return(s);}

main()

{double x,n;

scanf("%lf %lf",&x,&n);

printf("%.4lf",mypow(x,n));}


 

0.0分

0 人评分

  评论区