import java.util.*;

public class Solution { /** * * @param x int整型 * @return int整型 / public int reverse (int x){ // write code here long ans = 0; while (x != 0){ ans = ans10+(x%10); x/=10; } if(ans<Integer.MIN_VALUE||ans>Integer.MAX_VALUE){ ans = 0; System.out.println("反转后数字溢出"); } return (int)ans; } }