解题思路:
注意事项:
参考代码:
import java.math.BigInteger;
import java.util.*;
public class Test {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
BigInteger n = scanner.nextBigInteger();
BigInteger item = BigInteger.ONE;
BigInteger i = BigInteger.ONE;
BigInteger bigInteger = BigInteger.ZERO;
while (i.compareTo(n) <= 0) {
item = item.multiply(i);
i = i.add(BigInteger.ONE);
bigInteger = bigInteger.add(item);
}
System.out.println(bigInteger);
}
}
0.0分
0 人评分
采药 (C++代码)浏览:1265 |
明明的随机数 (C++代码)浏览:817 |
C语言训练-求PI* (C语言代码)浏览:883 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:525 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:758 |
字符串对比 (C语言代码)浏览:1398 |
简单的a+b (C语言代码)浏览:596 |
用筛法求之N内的素数。 (C语言代码)浏览:802 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:1415 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:534 |