标签:source main lcm tin resource imp pre ann bre
package suxueyuanli;
import java.util.Scanner;
public class Lcm {
public static void main(String[] args) {
System.out.println("请输入两个正整数:");
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
@SuppressWarnings("resource")
Scanner scan2=new Scanner(System.in);
int x=scan.nextInt();
int y=scan2.nextInt();
int sum=0;
for(int i=1;i>0;i++) {
sum=i*y;
if(sum%x==0) {
System.out.println(+x+"与"+y+"的最小公倍数为"+sum);
break;
}
}
}
}
标签:source main lcm tin resource imp pre ann bre
原文地址:https://www.cnblogs.com/llj123/p/13761729.html