潮州市网站建设_网站建设公司_腾讯云_seo优化
2026/1/16 11:02:55 网站建设 项目流程

同力扣376

#include <iostream> #include <cstring> using namespace std; string s; bool check(string& s, int i, int j) { while (i < j) { if (s[i] != s[j]) return false; i ++, j --; } return true; } int main() { cin >> s; for (int i = 0, j = s.size() - 1; i < j; i ++, j -- ) { if (s[i] != s[j]) { if (check(s, i + 1, j) || check(s, i, j - 1)) { cout << "true" <<endl; return 0; } cout << "false" << endl; return 0; } } cout << "true" << endl; return 0; }

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询