than the size

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.