java求两个数的最小公倍数

import java.util.Scanner;
// 输入两个数,求这两个数的最小公倍数
public class Work5 {

public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int x = scanner.nextInt();
    int y = scanner.nextInt();
    Work4 work4 = new Work4();
    int result = Work4.euclidean_algorithm(x,y);
    int out = x*y/result;
    System.out.println(out);
    scanner.close();
}

}

posted @ 2022-03-22 12:19  花痴dy  阅读(503)  评论(0编辑  收藏  举报