A+b problem (V)

Source: Internet
Author: User

After describing the a+b problem, Yougth felt too simple, so he wanted you to find the value added after the two number reversal. Help him, please.

 
Input
There are multiple sets of test data. Each group consists of two numbers m and N, the data guarantees the int range, when m and N are at the same time 0 is the input end.
Output
the result of adding after the output is reversed.
Sample input
1234 1234125 1170 0
Sample output
86421232

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         intNumber1;9         intnumber2;Ten          One          while(true){ AA=Scanner.next (); -b=Scanner.next (); -              the             if(A.compareto ("0") ==0 && B.compareto ("0") ==0) -                  Break; -              -A=NewStringBuffer (a). Reverse (). toString (); +b=NewStringBuffer (b). reverse (). toString (); -number1=Integer.parseint (a); +Number2=Integer.parseint (b); ASystem.out.println (number1+number2); at         } -     }  -}

A+b problem (V)

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.