2 条题解

  • -1
    @ 2025-12-18 21:14:36

    #include #include using namespace std;

    int main() { string s; getline(cin, s);

    int left = 0, right = s.length() - 1;
    bool isPalindrome = true;
    
    while (left < right) {
        if (s[left] != s[right]) {
            isPalindrome = false;
            break;
        }
        left++;
        right--;
    }
    
    if (isPalindrome) {
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }
    
    return 0;
    

    }

    信息

    ID
    6981
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    2
    已通过
    2
    上传者