1039: 计算1977!

编写一个程序,计算1977!的值

import java.math.BigInteger;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        
        System.out.println(ff(1977));
        cin.close();
    }
    private static BigInteger ff(int m) {
    BigInteger s=BigInteger.ONE;
    for(int i=2;i<=m;i++)
    s=s.multiply(new BigInteger(String.valueOf(i)));
    return s;
    }
 
}//这题eclipse的缓冲区存储空间会不够,直接提交到oj上是对的

猜你喜欢

转载自blog.csdn.net/progammer10086/article/details/80299404