chenxi1944362410
package erase;
import java.util.Scanner;
public class 阶乘数相加 {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        Jieshu(n);
    }
    public static void Jieshu(int n) {
        int sum = 0;
        for(int i=1;i<=n;i++) {
            int count = 1;
            for(int j=1;j<=i;j++) {
                 count*=j;
            }
            sum+=count;
        }
        System.out.print(sum);
    }

}

 

分类:

JAVA

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-08-11
  • 2021-05-15
  • 2022-12-23
  • 2022-02-05
相关资源
相似解决方案