九度+大数运算+Java直接调用BigInteger,注意必须定义的是Main类OJ才过

点击打开链接
import java.util.Scanner;
import java.math.*;
import java.text.*;
public class Main {
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
	 Scanner cin = new Scanner ( System.in );
	 BigInteger a,b;
	 while(cin.hasNext()){///相当于!=EOF
		 a=cin.nextBigInteger();
		 b=cin.nextBigInteger();
		 System.out.println(a.add(b));
		 System.out.println(a.subtract(b));
		 System.out.println(a.multiply(b));
		 }
	 }
}

你可能感兴趣的:(高精度)