标签:bool isp etc cpp 问题: return ali string code
class Solution {
public:
bool isPalindrome(int x) {
string str;
str=to_string(x);
int len=str.size();
for(int i=0;i<=len/2;i++){
if(str[i]!=str[len-i-1]) return false;
}
return true;
}
};
还没有解决的问题:你能不将整数转为字符串来解决这个问题吗?(思考ing)
标签:bool isp etc cpp 问题: return ali string code
原文地址:https://www.cnblogs.com/lettleshel/p/9016844.html