1 条题解

  • 0
    @ 2025-8-27 19:51:07

    C++ :

    #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((j!=1 && j!=N) && i==(N+1)/2) cout<<'-';
    			else cout<<'a';
    		}
    		cout<<endl;
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    5338
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者