题解
2024-12-29 09:01:19
发布于:江苏
28阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n/2;i++){
for(int j=0;j<i;j++){
cout<<' ';
}
for(int j=0;j<n-2*i;j++){
cout<<'*';
}
cout<<"\n";
}
for(int i=n/2;i>=0;i--){
for(int j=i;j>0;j--){
cout<<' ';
}
for(int j=n-2*i;j>0;j--){
cout<<'*';
}
cout<<"\n";
}
return 0;
}
这里空空如也
有帮助,赞一个