class Solution {
public int reverse(int x) {
long n=0;
while(x!=0){
n=n*10+x%10;
x=x/10;
}
return (int)n==n? (int)n:0;
}
}
7. 整数反转 Java版
最新推荐文章于 2024-09-15 09:47:04 发布