永发信息网

1000的阶乘等于多少?

答案:3  悬赏:10  手机版
解决时间 2021-02-19 14:37
1000的阶乘等于多少?
最佳答案
4.02387260077093773543702433923e+2567

用这个计算吧。。。。

#include
#include

int main( )
{
int n=1000, i;
double sum=0;
for(i=1; i<=n; i++)
sum += log10((double)(i));
printf("%d\n", (int)sum+1);
}
全部回答
#include //任意键入1-1000的数,输出他的阶乘
#include
int a[10000];
int cheng(int p)
{
int i=9999;
while(a[i]==0)
i--;
for(;i>=0;i--)
a[i]=p*a[i];
for(i=0;i<10000;i++)
{
a[i+1]=a[i+1]+a[i]/10;
a[i]=a[i]%10;
}
}
int display()
{
int i=9999;
while(a[i]==0)
i--;
for(;i>=0;i--)
printf("%d",a[i]);
}
int main()
{
a[0]=1;
int d,i;
scanf("%d",&d);
for(i=2;i<=d;i++)
cheng(i);
if(d==1)
printf("1");
else
display();
return 0;
}
1000!=4023872600770937735437024339230039857193748642107146325437999104299385123986290205920442084869694048004799886101971960586316668729948085589013238296699445909974245040870737599188236277271887325197795059509952761208749754624970436014182780946464962910563938874378864873371191810458257836478499770124766328898359557354325131853239584630755574091142624174743493475534286465766116677973966688202912073791438537195882498081268678383745597317461360853795345242215865932019280908782973084313928444032812315586110369768013573042161687476096758713483120254785893207671691324484262361314125087802080002616831510273418279777047846358681701643650241536913982812648102130927612448963599287051149649754199093422215668325720808213331861168115536158365469840467089756029009505376164758477284218896796462449451607653534081989013854424879849599533191017233555566021394503997362807501378376153071277619268490343526252000158885351473316117021039681759215109077880193931781141945452572238655414610628921879602238389714760885062768629671466746975629112340824392081601537808898939645182632436716167621791689097799119037540312746222899880051954444142820121873617459926429565817466283029555702990243241531816172104658320367869061172601587835207515162842255402651704833042261439742869330616908979684825901254583271682264580665267699586526822728070757813918581788896522081643483448259932660433676601769996128318607883861502794659551311565520360939881806121385586003014356945272242063446317974605946825731037900840244324384656572450144028218852524709351906209290231364932734975655139587205596542287497740114133469627154228458623773875382304838656889764619273838149001407673104466402598994902222217659043399018860185665264850617997023561938970178600408118897299183110211712298459016419210688843871218556461249607987229085192968193723886426148396573822911231250241866493531439701374285319266498753372189406942814341185201580141233448280150513996942901534830776445690990731524332782882698646027898643211390835062170950025973898635542771967428222487575867657523442202075736305694988250879689281627538488633969099598262809561214509948717012445164612603790293091208890869420285106401821543994571568059418727489980942547421735824010636774045957417851608292301353580818400969963725242305608559037006242712434169090041536901059339838357779394109700277534720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
我是用FREE PASCAL编的
var
SD:text;
a:array [1..1000000] of Qword;
m,b,c,i,j,x,y:longint;
begin
assign(SD,'SD.txt');
fillchar(a,sizeof(a),0);
j:=1;
a[1]:=1;
m:=1;
readln(c);
for i:=2 to c do
begin
x:=0;
for b:=m to j do
begin
a[b]:=a[b]*i+x;
x:=a[b] div 1000000000000;
a[b]:=a[b] mod 1000000000000;
end;
while x<>0 do
begin
j:=j+1;
a[j]:=x mod 1000000000000;
x:=x div 1000000000000;
end;
while a[m]=0 do inc(m);
end;
rewrite(SD);
write(SD,c,'!=');
write(SD,a[j]);
for i:=j-1 downto 1 do
if a[i]<10 then write(SD,'00000000000',a[i])
else if a[i]<100 then write(SD,'0000000000',a[i])
else if a[i]<1000 then write(SD,'000000000',a[i])
else if a[i]<10000 then write(SD,'00000000',a[i])
else if a[i]<100000 then write(SD,'0000000',a[i])
else if a[i]<1000000 then write(SD,'000000',a[i])
else if a[i]<10000000 then write(SD,'00000',a[i])
else if a[i]<100000000 then write(SD,'0000',a[i])
else if a[i]<1000000000 then write(SD,'000',a[i])
else if a[i]<10000000000 then write(SD,'00',a[i])
else if a[i]<100000000000 then write(SD,'0',a[i])
else write(SD,a[i]);
writeln;
readln;
close(SD);
end.
算50000!都只须40S
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
为什么不想和女生聊天
剑侠情缘三七秀的技能在哪儿学?
饮水机只制冷不制热了是什么坏了
【雨果作品】法国浪漫主义文学大师雨果的作品
谁有好看的叔侄恋言情小说,结局好,不太虐的
是不是公猫绝育了之后就不咬人了'
如果有人跟你说我和你在一起没有好日子过,这
女友打我那里,怎么办?
关于剑三丐帮加10%外攻的buff
玄武区锁金护理院在哪里啊,我有事要去这个地
宁夏驾校现在报名费多少钱
军埠口综合项目区中心社区服务中心地址有知道
7.5÷x一40=0.2
湛江霞山区京穗船机设备维修经营部怎么去啊,
已知sina=-2分之根号3.求cosa,tana的值
推荐资讯
全新轩逸、朗逸、卡罗拉,三款车型的动力谁更
瑞典足球队在世界杯历史上夺过几次冠军?
晾霸智能电动晾衣机地址在什么地方,想过去办
超市里买的甜米酒能用作酒曲酿米酒吗?
晨光熹微的意思
彭水到龙射出口是???
请问,装备~~~~~~~~~,我看到别人都有好多装备
如图为甲病(A-a)和乙病(B-b)的遗传系谱图。
含“笼”字的成语有哪些?
平行四边形有容易变形的特性.
我的手机是OPPOR6007手机上没存多少东西就总
下列不属于生态系统的是DA. 一片农田B. 一块
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?