SDUT PTA JAVA12 常用类(日期、数学、封装类、随机数等)习题
作者:互联网
7-1 sdut-常用类-骄傲的代价 (10 分)
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long t=sc.nextLong();
for(int i=0;i<t;i++) {
BigInteger a=sc.nextBigInteger();
BigInteger b=sc.nextBigInteger();
System.out.println(a+"+"+b+"="+a.add(b));
System.out.println(a+"-"+b+"="+a.subtract(b));
System.out.println(a+"*"+b+"="+a.multiply(b));
System.out.println(a+"/"+b+"="+a.divide(b));
System.out.println(a+"%"+b+"="+a.mod(b));
}
sc.close();
}
}
标签:java,Scanner,JAVA12,PTA,util,sc,import,习题,public 来源: https://www.cnblogs.com/kingwz/p/15573004.html