728x90
import java.math.*;
public class main3
{
    public static void main(String[] args)
    {
        BigInteger n = new BigInteger("12345"); // 12345
        BigInteger m = new BigInteger("54321"); // 54321
        System.out.print(n.compareTo(m));   // -1

        // n < m => -1 반환
        // n == m => 0 반환
        // n > m => 1 반환
    }
}
728x90
Posted by 바르마스
,