标签:blog ar java div 2014 c log r ad
除法的结果存在数组,商下标为0 余数下标为1
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner in = new Scanner(System.in); BigInteger a = in.nextBigInteger(); BigInteger b = in.nextBigInteger(); System.out.println("Add " + a.add(b)); System.out.println("Sub " + a.subtract(b)); System.out.println("Multi " + a.multiply(b)); System.out.println("Div " + a.divide(b)); System.out.println("Max " + a.max(b)); System.out.println("Min " + a.min(b)); BigInteger result[] = a.divideAndRemainder(b); System.out.println("Divide " + result[0] + " Remainder " + result[1]); } }
标签:blog ar java div 2014 c log r ad
原文地址:http://blog.csdn.net/u011026968/article/details/39668263