12 solutions

  • 1
    @ 2026-2-6 10:24:57
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a,b,d;
        char c;
        cin>>a>>b>>c>>d;
        for(int i=1;i<=a;i++)
        {
            for(int j=1;j<=b;j++)
            {
                if(i==1 || i==a || j==1 || j==b)
                {
                    cout<<c;
                }
                else if(d==0)
                {
                    cout<<" ";
                }
                else
                {
                    cout<<c;
                }    
                
            }
            cout<<endl;
        }
        return 0;
    }
    

    Information

    ID
    885
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    171
    Accepted
    66
    Uploaded By