Leetcode Reverse Integer
class Solution {
public:
int reverse(int x)
{
int y=abs(x);
int z=0;
while(y>0)
{
z=z*10+y%10;
y=y/10;
}
if(x>0)return z;
if(x<0)return -z;
}
};
浙公网安备 33010602011771号