酷代码 AI
菜单
服务商

用C++判断嫌疑人信息字符串是否为回文串

```cpp #include <iostream> #include <string> int main() { std::string str; std::cin >> str; int left = 0; int right = str.length() - 1; bool isPalindrome = true; while (left < right) { if (str[left] != str[right]) { isPalindrome = false; break; } left++; right--; } if (isPalindrome) { std::cout << "yes" << std::endl; } else { std::cout << "no" << std::endl; } return 0; } ``` ######[AI问答 | 188点数解答 | 2026-05-16 20:27:17]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]