您看满意否,满意请采纳
#include
void main ()
{
int n = 1, i;
int sum = 0;
for (i = 1; i <= 10; ++i)
{
n *= i;
sum += n;
}
printf("结果为:%d", sum);
}
#include
void main ()
{
int i,n,j,sum=0;
int m;
scanf("%d",&n);
for(i=1;i<=n;++i)
{
m=1;
for(j=1;j<=i;++j)
m*=j;
sum=sum+m;
}
printf("1!+2!+...n!=%d\n",sum);
}
#include
main()
{
int i,j;
int s=0;
for(i=1;i<=10;i++)
{
int s1=1;
for(j=1;j<=i;j++)
s1=s1*j;
s=s+s1;
}
printf("%d",s);
}
#include
int main()
{
int sum = 0;
int step = 1;
int i;
for(i=1;i<=10;i++)
{
step *= i;
sum += step;
}
printf("Answer = %d\n",sum);
}