- 求两个数的最小公倍数
解题思路,两个数的乘积除以两个数的最大公约数为最小公倍数
//package PTACZW; import java.util.Scanner; import java.math.BigInteger; public class Main{ public static void main(String[]args) { Scanner input=new Scanner(System.in); BigInteger a=input.nextBigInteger(); BigInteger b=input.nextBigInteger(); System.out.println(a.multiply(b).divide(a.gcd(b))); } }
标签:BigInteger,java,Scanner,22,公倍数,2023,input,07 From: https://www.cnblogs.com/liliczw2209/p/17573209.html