可以计算大(8位)阶乘的c ++程序 [英] c++ program that can calculate big (8-digit) factorials

查看:95
本文介绍了可以计算大(8位)阶乘的c ++程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i必须编写一个c ++程序,可以使用17的矢量(例如c)计算大因子,c [i]可以容纳8位

i需要帮助

plz帮助我

解决方案

转移到C论坛,驻地专家可以更好地为您提供帮助。


**从编程挑战中移出。



hi

i必须写一个c ++可以使用17号矢量(例如c)和c [i]计算大因子的程序可以容纳8位数

i需要帮助

plz帮我



当然,你到目前为止有什么?



当然,你有什么至今?



i已经做了但是我的代码不正确

i不知道如何收集我所拥有的所有信息。我写的是像这样:

int a; //我们想要计算其阶乘的数字

int n = a; int b = a;

for(int i = 16; i> = 0; i = i + 1)

{c [i] = n;

而(c [i]< p)// p是e + 9

{b = b-1;

c [i] =(c [i] *(b%10))+(c [i] *(b / 10)* 10) ;

}

}

但我知道错了

你能帮我开始一个新代码吗?


hi
i have to write a c++ program that can calculate big factorials using a vector sized 17(for example c)and c[i] can hold 8 digits
i need help
plz help me

解决方案

Moved to the C Forums where the resident experts can better assist you.

**Moved from Programming Challenges.


hi
i have to write a c++ program that can calculate big factorials using a vector sized 17(for example c)and c[i] can hold 8 digits
i need help
plz help me

Sure, what do you have so far?


Sure, what do you have so far?

i have done sth abt it but my code is incorrect
i do not know how to gather all the informations that i have.i wrote sthe like this:
int a ; //the number which we want to calculate its factorial
int n=a;int b=a;
for(int i=16;i>=0;i=i+1)
{ c[i]=n;
while(c[i]<p) //p is e+9
{ b=b-1;
c[i]=(c[i]*(b%10))+(c[i]*(b/10)*10);
}
}
but i know its wrong
could you plz help me starting a new code?


这篇关于可以计算大(8位)阶乘的c ++程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆