title | categories | ||
---|---|---|---|
回文数 |
|
package main
import "strconv"
/*
* @lc app=leetcode.cn id=9 lang=golang
*
* [9] 回文数
*/
// @lc code=start
func isPalindrome(x int) bool {
bigString := strconv.Itoa(x)
for i := 0; i <= len(bigString)/2; i++ {
if bigString[i] == bigString[len(bigString)-1-i] {
continue
} else {
return false
}
}
return true
// @lc code=end
}