apply


私信TA

用户名:uq_71543461426

访问量:1121

签 名:

等  级
排  名 3613
经  验 1778
参赛次数 0
文章发表 6
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

参考代码:

import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		BigInteger a = cin.nextBigInteger();
		BigInteger b = cin.nextBigInteger();
		System.out.print(gcd(a, b).toString());
	}
	public static BigInteger gcd(BigInteger a, BigInteger b) {
	    int val = b.compareTo(new BigInteger("0"));
	    return val != 0 ? gcd(b, a.remainder(b)) : a;
	}
}


 

0.0分

0 人评分

  评论区