//1!+2!+3!+....+20!
#include<stdio.h>
int main()
{
int i , j ;
long num = 1 , sum = 0 ;
for( i = 1 ; i <= 20 ; i++ )
{
num *= i ;
sum += num ;
}
printf("结果是:%ld\n",sum) ;
return(0) ;
}
#include <stdio.h>
int main ()
{
double sum = 0, fac = 1;
int n, i;
scanf("%d", &n);
for (i = 1;i <= n;i ++)
{
fac *= i;
sum += fac;
}
printf("%.0lf", sum);
return 0;
}