#include<stdio.h>
int main()
{
int n=0;
int ret=1; //阶乘
int sum=0; //和
for(n=1;n<=10;n++) //限定n的范围
{
ret=ret*n;
sum=sum+ret;
}
printf("sum=%d\n",sum);
return 0;
}
标签:10,int,sum,ret,计算,阶乘,+......+,main From: https://blog.51cto.com/u_16329012/8175409
#include<stdio.h>
int main()
{
int n=0;
int ret=1; //阶乘
int sum=0; //和
for(n=1;n<=10;n++) //限定n的范围
{
ret=ret*n;
sum=sum+ret;
}
printf("sum=%d\n",sum);
return 0;
}
标签:10,int,sum,ret,计算,阶乘,+......+,main From: https://blog.51cto.com/u_16329012/8175409