第八周4

来源:互联网 发布:tvb直播软件 编辑:程序博客网 时间:2024/05/11 00:28
 

 

#include <iostream>
using namespace std;
int main()
{
 int i,j,k,n=11;
 i=1;
 while (i<=6)
 {
 k=1;
 while (k<=6-i)
 {
 cout <<' ';
 k++;
 }
 j=1;
 while (j<=2*i-1)
 {
 cout<<'*';
 j++;
 }
 cout <<endl;
 i++;
 }
 while(i<=n)
 {
 k=1;
 while (k<=i-6)
 {
 cout<<' ';
 k++;
 }
 j=1;
 while(j<=23-2*i)
 {
 cout<<'*';
 j++;
 }
 cout<<endl;
 i++;
 }
 return 0;
}