package 练习12A;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class XiTi6 {
//输入两个正整数m和n,求其最大公因数和最小公倍数
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
while (true) {
List<Integer> list1 = new ArrayList<>();
List<Integer> list2 = new ArrayList<>();
List<Integer> list3 = new ArrayList<>();
System.out.println("输入两个整数");
int a = scan.nextInt();
int b = scan.nextInt();
int s=a;
int s1=b;
for (int i = 2; i <= a; i++) {
while (a % i == 0) {
a = a / i;
list1.add(i);
}
}
for (int i = 2; i <= b; i++) {
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载