1 solutions

  • 0
    @ 2025-11-29 9:19:54
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		for(int j=1;j<=n;j++)
    		{
    			if(j==1||j==n) cout<<"|";
    			else if((n+1)/2==i) cout<<"-";
    			else cout<<"a";
    		}
    		cout<<endl;
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    2533
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    (None)
    # Submissions
    41
    Accepted
    16
    Uploaded By