import java.util.Scanner;
public class Han {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//输入两个数m,n
System.out.println("请输入第一个数x=");
Scanner in = new Scanner(System.in);
int x = in.nextInt();
System.out.println("请输入第二个数y=");
int y = in.nextInt();
int r;
while(y!=0){
r = x%y;
x = y;
y = r;
}
System.out.println("最大公约数为99");
System.out.println(x);
}
}
时间: 2024-10-24 14:15:57