> 其他 >
编写程序计算级数ex=1+x+x2/2!+x3/3!+...+xn/n!的值.
要求:要采用函数调用,一个函数实现n!,另一个函数实现xn
人气:202 ℃ 时间:2020-04-10 07:22:50
解答
#include
using namespace std;
int pow(int x,int n);
int f1(int n);
int main(int argc,char* argv[])
{
int x,n;
double ex = 1;
cin >> x;
cin >> n;
for (int i=1; i
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版