import java.util.Scanner;
public class TestDemo {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int n1= scanner.nextInt();
int n2= scanner.nextInt();
int m=n2%n1;
while (m!=0){
n2=n1;
n1=m;
m=n2%n1;
}
System.out.println(n1);
}
}
求最大公约数
最新推荐文章于 2024-11-09 12:43:52 发布