题目:
题解:
bool isalumn(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
}
bool isPalindrome(char* s) {
for (int left = 0, right = strlen(s) - 1; left < right; left++, right--) {
while (left < right && !isalumn(s[left])) {
left++;
}
while (left < right && !isalumn(s[right])) {
right--;
}
if (tolower(s[left]) != tolower(s[right])) {
return false;
}
}
return true;
}