import java.util.Scanner;
public class exp {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("输入数:");
int n = scanner.nextInt();
int temp = 1, sum = 0;
for (int i = 1; i <= n; i++) {
//* temp保存每一个数的阶乘
temp = temp * i;
// sum保存所有数的阶乘的和
sum = sum + temp;
}
System.out.println("结果是:" + sum);
}
}