且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

可以计算大(8位)阶乘的c ++程序

更新时间:2023-02-19 23:15:35

转移到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?