第一行数字a,第二行数字b。
一行一个数字表示答案
6 4
2
7951346523609888 6998915114363550
1013754
import java.util.*; import java.math.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { BigInteger a = sc.nextBigInteger(); BigInteger b = sc.nextBigInteger(); System.out.println(a.gcd(b)); } } }
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题