题解 | #数字翻转#
数字翻转
https://www.nowcoder.com/practice/bc62febdd1034a73a62224affe8bddf2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextInt() + ""; String t = sc.nextInt() + ""; StringBuilder s1 = new StringBuilder(s).reverse(); StringBuilder s2 = new StringBuilder(t).reverse(); int r1 = Integer.parseInt(s1.toString()); int r2 = Integer.parseInt(s2.toString()); int r = r1 + r2; StringBuilder sb = new StringBuilder(Integer.toString(r)).reverse(); System.out.println(Integer.parseInt(sb.toString())); } }