判断难一点
2026-11-03 21:17:17
发布于:江苏
0阅读
0回复
0点赞
#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++){
if(i==j){
cout<<'*';
}else if(i==n-j-1||n-i-1==j){//要减1
cout<<'*';
}else if(i==0||i==n-1||j==0||j==n-1){
cout<<"#";
}else{
cout<<'.';
}
}cout<<endl;
}
return 0;
}
这里空空如也







有帮助,赞一个