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)