object Solution {
def isPalindrome(x:Int):Boolean={
// 有负号必然不是if(x <0)returnfalse// 只有一个数字的数值肯定是if(0<= x && x <=9)returntrueval s = x.toString
for(i <-0 until s.length /2)if(s(i)!= s(s.length - i -1))returnfalsetrue}}
object Solution {
def isPalindrome(x:Int):Boolean={
if(x <0)returnfalseif(0<= x && x <=9)returntruevar t = x
var res =0while(t !=0){
res = res *10+(t %10)
t /=10}
res == x
}}