力扣7.数字反转(C语言)
public ;static long long int reverse(long long int x) {
long long int i,r=0,ret;
while(x)
{
r=r*10+x%10;
x/=10;
}
if(fabs(r)>2147483647)//2的31次方-1
ret=0;
else
ret=r;
return ret;
}
力扣7.数字反转(C语言)
public ;static long long int reverse(long long int x) {
long long int i,r=0,ret;
while(x)
{
r=r*10+x%10;
x/=10;
}
if(fabs(r)>2147483647)//2的31次方-1
ret=0;
else
ret=r;
return ret;
}