감 ¶
Gcd.java ¶
~cpp
import java.util.Scanner;
import java.math.BigInteger;
public class Gcd
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
BigInteger bigInteger1, bigInteger2, gcdNum;
bigInteger1 = input.nextBigInteger();
bigInteger2 = input.nextBigInteger();
gcdNum = bigInteger1.gcd(bigInteger2);
System.out.println("The GCD of " + bigInteger1 + " and " + bigInteger2 + " is " + gcdNum);
}
}










