<pre>
bool isPalindrome(int x) {
stringstream stringstream_x;
stringstream_x<< x;
string string_x = stringstream_x.str();
string string1(string_x);
reverse(string_x.begin(),string_x.end());
if (string1.compare(string_x) ==0){
return true;
}else{
return false;
}
// int x_reverse;
// stringstream stream(string_x);
// stream>> x_reverse;
}
</pre>
网友评论