实现代码:
#include<iostream>
using namespace std;
int main(){
int i,j;
for(i=0;i<4;i++){
cout<<"\t\t";
for(j=0;j<3-i;j++)cout<<" ";
for(j=0;j<2*(i+1)-1;j++)cout<<"*";
cout<<endl;
}
for(i--;i>=0;i--){
cout<<"\t\t";
for(j=0;j<3-i;j++)cout<<" ";
for(j=0;j<2*(i+1)-1;j++)cout<<"*";
cout<<endl;
}
return 0;
}