还是Java大法好

import java.util.*;
import java.math.*;
public class Main
{
    static BigInteger lcm(BigInteger a, BigInteger b)
    {
        return a.divide(a.gcd(b)).multiply(b);
    }
    public static void main(String args[])
    {
        Scanner cin = new Scanner(System.in);
        BigInteger a = cin.nextBigInteger();
        BigInteger b = cin.nextBigInteger();
        System.out.print(lcm(a, b));
    }
}

0 条评论

目前还没有评论...

信息

ID
1047
难度
8
分类
高精度 点击显示
标签
(无)
递交数
7406
已通过
776
通过率
10%
被复制
25
上传者