int reverse(int x){
double i = 0;
while(x != 0){
i = i * 10 + x % 10;
x = x / 10;
}
return i == (int)i ? (int)i:0;
}
7. 整数反转个人解法
最新推荐文章于 2024-09-10 15:28:21 发布
int reverse(int x){
double i = 0;
while(x != 0){
i = i * 10 + x % 10;
x = x / 10;
}
return i == (int)i ? (int)i:0;
}