标签:main nbsp int 图片 print soft ann scanner ++
代码:
1 import java.util.*;
2 public class Main {
3 public static void main (String [] args) {
4 Scanner scan=new Scanner(System.in);
5 int n=scan.nextInt();
6 int sum=0;
7 for(int i=1;i<=n;i++) {
8 int p=1;
9 for(int j=1;j<=i;j++) {
10 p*=j;
11 }
12 sum+=p;
13 }
14 System.out.println(sum);
15 }
16 }
标签:main nbsp int 图片 print soft ann scanner ++
原文地址:https://www.cnblogs.com/fandehui/p/11040667.html