C程序计算1!+2!+3!+4!+5!+6!+7!+8!+9!+10!+11!+12!+13!+14!+15!+16!+17!+18!+19!+20!
问题描述:
C程序计算1!+2!+3!+4!+5!+6!+7!+8!+9!+10!+11!+12!+13!+14!+15!+16!+17!+18!+19!+20!
答
#include
阶乘和和阶乘乘积用整型变量不行,会溢出.
void main()
{
long t,s;
int i;
t=1;
s=0;
for(i=1;i