标签:double img inf code ble int bsp 小数 技术
#include <stdio.h>
int main()
{
int n;
double s=0,t=1;
//s不应定义为int int所能存储数据范围较小 t同理 作为阶乘存储数据范围较大
for(n=1;n<=20;n++)
{
t=t*n;
s=t+s;
}
printf("前二十项阶乘:%22.15e\n",s);
//数据宽度22 数字部分中小数位数为15位 前二十项阶乘:2.561327494111820e+018
return 0;
}
标签:double img inf code ble int bsp 小数 技术
原文地址:https://www.cnblogs.com/LiQingXin/p/12851721.html