import java.util.*;
import java.math.*;
public class Main {
static BigInteger res=BigInteger.ZERO;
static BigInteger f(int a) {
BigInteger b=BigInteger.ONE;
for(int i=1;i<=a;i++) {
b=b.multiply(BigInteger.valueOf(i));
}
return b;
}
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int n=input.nextInt();
for(int i=1;i<=n;i++) {
res=res.add(f(i));
}
System.out.println(res);
}
}
【P1009 [NOIP1998 普及组] 阶乘之和】【Java】
猜你喜欢
转载自blog.csdn.net/m0_57937908/article/details/119988777
今日推荐
周排行