📄 2836862_ac_250ms_5188k.java
字号:
import java.util.*;
import java.math.*;
public class Main {
static BigInteger one = new BigInteger ("1");
static BigInteger two = new BigInteger ("2");
public static BigInteger fact(BigInteger n)
{
if(n.intValue()==1)
return n;
else
return n.multiply(fact(n.subtract(one)));
}
public static void main(String[] args) {
Scanner cin = new Scanner (System.in);
BigInteger n;
while(true)
{
n = cin.nextBigInteger();
if (n.intValue()==-1)
break;
System.out.println("N="+n+":");
n = n.subtract(one);
n = fact(n);
n = n.multiply(two);
System.out.println(n);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -