帮忙看看这个句子哪里不对

来源:百度知道 编辑:UC知道 时间:2024/07/01 01:43:15
main()
{
int i,t;
i=1;
t=2;
while(i<=5)
{i=t*i;
t=t+1;
}
printf("%d%",i);
getchart();
}

---------------------------------------
不知道为什么 提示错误
问题找出来了 前面少个 #include <stdio.h>
可是又出现一个问题
就是这个公式尾数算不到100!
我用BAT也算了下还是算不到100
为什么啊

源代码给你改了下。
#include "stdio.h"
main()
{
int i=1,t=1;

while(i<=5)
t=t*i++;

printf("%d",t);
getch();
}

getchart();这个是什么?没见过这函数的。
可能多个t。
算不到100的阶乘那是应该的。
8!=40320 已经大于int类型的范围了。所以这程序只能算到7!。
想精度提高,可以用自己写算法。
如:在我的空间里 就有我写的N位浮点数的加法。利用自己写的字符串数字(把数字弄成字符串)相加算法。