2个数A,B,中间用空格隔开。(1<= A,B <= 10^9)Output
输出A与B的最大公约数。Input示例
30 105Output示例
15
code:AC
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
System.out.println(gcd(a,b));
}
public static int gcd(int m , int n){
return n==0 ? m :gcd(n,m%n);
}
}