Java(求最小公倍数)

来源:互联网 发布:本子软件 编辑:程序博客网 时间:2024/06/14 02:52
import java.math.BigInteger;import java.util.Scanner;public class Main {    public static void main(String[] args) {        Scanner in = new Scanner(System.in);        while(in.hasNext())        {            BigInteger a,b;            a=in.nextBigInteger();            b=in.nextBigInteger();            BigInteger temp;            temp=a.multiply(b).divide(a.gcd(b));            System.out.println(temp);        }    }}
0 0
原创粉丝点击