2 solutions

  • 0
    @ 2026-2-22 16:29:03
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        for(int i=0;i<n;i++)
        {
            cout<<"|";
            for(int j=0;j<n-2;j++)
            {
                if(i==0||i==n-1||i==n/2)
                {
                    cout<<"-";
                }
                else
                {
                    cout<<"x";
                }
            }
            cout<<"|\n";
        }
    }
    

    Information

    ID
    37
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    6
    Tags
    # Submissions
    32
    Accepted
    11
    Uploaded By