NYOJ28 大数阶乘

原题链接


import java.util.Scanner;
import java.math.BigInteger;

public class Main{
	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int n = cin.nextInt();
		BigInteger a = BigInteger.ONE;
		for(int i = 2; i <= n; ++i)
			a = a.multiply(BigInteger.valueOf(i));
		System.out.println(a);
	}
}


你可能感兴趣的:(NYOJ28 大数阶乘)