class Solution {
public:
int reverse(int x) {
long n = 0;
while(x){
n = n * 10 + x % 10;
x /= 10;
}
return (int)n == n ? (int)n : 0;
}
};
整数反转
最新推荐文章于 2021-11-28 23:37:35 发布