class Solution {
public int reverse(int x) {
int res = 0;
while(x!=0){
res = res*10+x%10;
// 判断整数溢出
if(res%10!=x%10){
return 0;
}
x=x/10;
}
return res;
}
}
7.整数反转0ms
最新推荐文章于 2025-12-05 21:56:57 发布
920

被折叠的 条评论
为什么被折叠?



