首页 > 代码库 > hdu 5050 Divided Land(JAVA高精度)

hdu 5050 Divided Land(JAVA高精度)

import java.util.Scanner;import java.math.BigInteger;public class Main {    public static void main(String[] args) {        Scanner cin=new Scanner(System.in);        int T;        T=cin.nextInt();        BigInteger a,b;        for(int cas=1;cas<=T;cas++){            a=cin.nextBigInteger(2);            b=cin.nextBigInteger(2);            a=a.gcd(b);            System.out.println("Case #"+cas+": "+a.toString(2));        }    }}

 

hdu 5050 Divided Land(JAVA高精度)