5 条题解

  • 3
    @ 2022-1-24 9:49:13
    #include <iostream>
    #include <math.h>
    #include <string>
    #include <string.h>
    using namespace std;
    int main()
    {
        char a[1000];
        cin >> a;
        int len = strlen(a);
        bool flag = true;
        for (int i = 0;flag && i < len; i++)
        {
            if (a[i] != a[len - 1 - i])
            {
                flag = false;
            }
        }
        if (flag)
        {
            cout << "yes";
        }
        else
        {
            cout << "no";
        }
    }
    

    信息

    ID
    1121
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    递交数
    47
    已通过
    26
    上传者