import java.util.Scanner;
public class gys {
public static void main(String[] args) {
System.out.print("please input 2 nums:");
Scanner s1=new Scanner(System.in);
Scanner s2=new Scanner(System.in);
int a=s1.nextInt();
int b=s2.nextInt();
if(a<b){
int c=a;
a=b;
b=c;
}
while(true){
a=a-b;
if(a==b){
break;
}else if(a<0){
a=b;
}
if(a<b){
int c=a;
a=b;
b=c;
}
}
System.out.print("这两个数的最大公约数是:"+a);
}
public class gys {
public static void main(String[] args) {
System.out.print("please input 2 nums:");
Scanner s1=new Scanner(System.in);
Scanner s2=new Scanner(System.in);
int a=s1.nextInt();
int b=s2.nextInt();
if(a<b){
int c=a;
a=b;
b=c;
}
while(true){
a=a-b;
if(a==b){
break;
}else if(a<0){
a=b;
}
if(a<b){
int c=a;
a=b;
b=c;
}
}
System.out.print("这两个数的最大公约数是:"+a);
}
}