import java.util.Scanner;
public static void main(String[] args) {
int a = 0, b = 0, sum = 0;
System.out.println("请输入2个整数:");
Scanner scan = new Scanner(System.in);
a = scan.nextInt();
//Scanner sc = new Scanner(System.in);
b = scan.nextInt();
// System.out.println("a=" + a);
// System.out.println("b=" + b);
for (int i = 1; i <= a && i <= b; i++) {
if (a % i == 0 && b % i == 0) {
sum = i;
}
}
System.out.println(a + "," + b + "的最大公约数为:" + sum);
System.out.println(a + "," + b + "的最小公倍数为:" + a * b / sum);
}
}