输入:5
输出 :
*****
* *
* *
* *
* *
* *
* *
* *
*****
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int s,x,l,b,z;
cin>>b;
z = b-2;
for(int i=1;i<b;i++){
for(int j=1;j<=b-i;j++){
cout<<" ";
}
if(i==1){
for(int k=1;k<=b;k++){
cout<<"*";
}
}else{
cout<<"*";
for(int l=1;l<=z+i;l++){
cout<<" ";
}