import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner x = new Scanner(System.in);//构造一个SCANNER对象,其传入参数为SYSTEM.IN int n = x.nextInt();//读取一个INT数值 int sum = 0; for ( int i = 1; i <= n; i++) { int tmp = 1; for (int j = 1; j <= i; j++) tmp *= j; sum += tmp; } System.out.println(sum); } }