- chenxueze's blog
小杨的H字矩阵.代码
- 2024-12-2 20:51:30 @
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
char s;
if(j==0||j==n-1){
s='|';
}else if(i==n/2){
s='-';
}else{
s='a';
}
cout<<s;
}
cout<<endl;
}
return 0;
}