class Solution {
public:
int reverse(int x) {
int y = 0;
while(x!=0)
{
if(y>214748364 || y < -214748364 )
{return 0;}
y = y*10+x%10;
x=x/10;
}
return y;
}
};
leetcode(2)--整数反转
最新推荐文章于 2024-02-10 08:30:00 发布