解题思路:
注意事项:
参考代码:
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++代码)(都当成字符串吧hhhhhhhh)浏览:493 |
剔除相关数 (C语言代码)浏览:1012 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:523 |
C语言训练-求素数问题 (C语言代码)浏览:1452 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:599 |
成绩转换 (C语言代码)浏览:1005 |
计算质因子 (C++代码)浏览:1625 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:541 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:470 |
a+b浏览:432 |