Describe
Give you two big numbers, can you tell the size of their two numbers?
For example, 123456789123456789 to greater than-123456
-
- Input
-
- one row for each set of test data, enter two 1000-bit 10 binary integers, a, b
The data guarantees that the input a, B, has no prefix of 0.
If input 0 0 indicates the end of the input. No more than 10 groups of test data groups
-
- Output
-
If
- a>b outputs "a>b", if a<b outputs "a<b", then output "a==b" if equal.
-
- Sample input
-
-
111111111111111111111111111 88888888888888888888-1111111111111111111111111 222222220 0
-
- Sample output
-
A>ba<b
1 ImportJava.util.Scanner;2 3 Public classMain {4 Public Static voidMain (string[] args) {5Scanner scanner=NewScanner (system.in);6 String A;7 String B;8 Charasign;9 Charbsign;Ten One while(Scanner.hasnext ()) { AA=Scanner.next (); -b=Scanner.next (); - the if(A.compareto ("0") ==0 && B.compareto ("0") ==0) - Break; - -asign= ' 0 '; +bsign= ' 0 '; - + if(A.contains ("+")){ AAsign= ' + '; atA=a.substring (1, A.length ()); - } - Else if(A.contains ("-")){ -Asign= '-'; -A=a.substring (1, A.length ()); - } in Else -Asign= ' + '; to + if(B.contains ("+")){ -Bsign= ' + '; theB=b.substring (1, B.length ()); * } $ Else if(B.contains ("-")){Panax NotoginsengBsign= '-'; -B=b.substring (1, B.length ()); the } + Else ABsign= ' + '; the + //System.out.println (asign); - //System.out.println (a); $ //System.out.println (bsign); $ //System.out.println (b); - - if(asign== ' + ' && bsign== ' + '){ the if(A.length () >b.length ()) -System.out.println ("A>b");Wuyi the Else if(A.length () <b.length ()) -System.out.println ("A<b"); Wu - Else if(a.length () = =b.length ()) { About if(A.compareto (b) <0) $System.out.println ("A<b"); - Else if(A.compareto (b) ==0) -System.out.println ("A==b"); - Else ASystem.out.println ("A>b"); + } the } - Else if(asign== '-' && bsign== '-'){ $ if(A.length () >b.length ()) theSystem.out.println ("A<b"); the the Else if(A.length () <b.length ()) theSystem.out.println ("A>b"); - in Else if(a.length () = =b.length ()) { the if(A.compareto (b) <0) theSystem.out.println ("A>b"); About Else if(A.compareto (b) ==0) theSystem.out.println ("A==b"); the Else theSystem.out.println ("A<b"); + } - } the Bayi Else if(asign== ' + ' && bsign== '-') theSystem.out.println ("A>b"); the - Else -System.out.println ("A<b"); the } the } the } the -
than the size