本帖最後由 tonyh 於 2022-1-3 18:52 編輯
- import java.math.BigInteger;
- public class P6 {
- BigInteger x=new BigInteger("1999999999999999999999999999999999999999999999999");
- BigInteger y=new BigInteger("1000000000000000000000000000000000000000000000001");
- BigInteger i=new BigInteger("2100000000000000000000000000000000000000000000000");
- BigInteger j=new BigInteger("1400000000000000000000000000000000000000000000000");
- long a=1999999999999999999l;
- long b=1000000000000000001l;
- P6()
- {
- System.out.println(a+b);
- System.out.println(x.add(y));
- System.out.println(x.subtract(y));
- System.out.println(x.multiply(BigInteger.valueOf(2)));
- System.out.println(x.divide(y));
- System.out.println(x.remainder(y));
- System.out.println(i.gcd(j));
- System.out.println(j.pow(2));
- }
- public static void main(String[] args){
- new P6();
- }
- }
複製代碼 |