如果 X = 123,则rev(X) = 321;
如果 X = 100,则rev(X) = 1.
现在给出整数x和y,要求rev(rev(x) + rev(y))为多少?
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
int x = reader.nextInt();
int y = reader.nextInt();
System.out.println(rev(rev(x)+rev(y)));
}
public static int rev(int x){
StringBuffer buffer = new StringBuffer(x+"");
buffer.reverse();
return Integer.valueOf(buffer.toString());
}
}