Describe
Do a+b problem,a/b problem is not a problem!
-
- Input
-
- each set of test sample line, first a number a, one or more spaces in the middle, then a symbol (/or%), then another space, followed by a number b,a may be very long, B is an int range number.
-
- Output
-
- output results.
-
- Sample input
-
-
110/10099% 102147483647/21474836472147483646 2147483647
-
- Sample output
-
1912147483646
1 ImportJava.math.BigInteger;2 ImportJava.util.Scanner;3 4 Public classMain {5 Public Static voidMain (string[] args) {6Scanner scanner=NewScanner (system.in);7 BigInteger A;8 String sign;9 BigInteger B;Ten One while(Scanner.hasnext ()) { AA=Scanner.nextbiginteger (); -sign=Scanner.next (); -b=Scanner.nextbiginteger (); the - if(Sign.compareto ("/") ==0) - System.out.println (A.divide (b)); - Else + System.out.println (A.remainder (b)); - } + } A } at -
A/b problem