描述
做了A+B Problem,A/B Problem不是什么问题了吧!
110 / 100
99 % 10
2147483647 / 2147483647
2147483646 % 2147483647
1
9
1
2147483646
1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 public static void main(String[] args) { 6 Scanner scanner=new Scanner(System.in); 7 BigInteger a; 8 String sign; 9 BigInteger b; 10 11 while(scanner.hasNext()){ 12 a=scanner.nextBigInteger(); 13 sign=scanner.next(); 14 b=scanner.nextBigInteger(); 15 16 if(sign.compareTo("/")==0) 17 System.out.println(a.divide(b)); 18 else 19 System.out.println(a.remainder(b)); 20 } 21 } 22 } 23 24
原文:http://www.cnblogs.com/zqxLonely/p/4133691.html