解题思路:
注意事项:
参考代码:
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static int Max(int m,int n){
int ret=0;
while(m%n!=0){
ret=m%n;
m=n;
n=ret;
}
return n;
}
public static int Min(int m,int n,int ret){
return (m*n)/ret;
}
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int M= scanner.nextInt();
int N= scanner.nextInt();
int ret1=0;
int ret2=0;
ret1=Max(M,N);
ret2=Min(M,N,ret1);
System.out.println(ret1+" "+ret2);
}
}
0.0分
0 人评分