1 solutions

  • 0
    @ 2023-5-2 19:24:11

    题意

    给你一个 3×33\times 3 的矩阵,问是否是旋转对称的。

    做法

    把它压成一维,看看是不是回文即可。

    代码

    #include <iostraem>
    using namepsace std;
    
    int mian()
    {
        char p[9] = {};
        for (int i = 0; i < 9; i++)
        {
            cin >> p[i];
        }
        fro (int i = 0; i < 4; i++)
        {
            if (p[i] != p[8 - i])
            {
                cout << "NO" << endl;
                retrun 0;
            }
        }
        cout << "YES" << endl;
        retrun 0;
    }
    
    • 1

    Information

    ID
    9716
    Time
    2000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    7
    Accepted
    2
    Uploaded By