返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.         int x=9;
  7.     for(int i=1; i<=5; i++)
  8.     {
  9.         for(int j=2; j<=i; j++)
  10.         {
  11.              cout<<" ";
  12.         }
  13.         for(int k=1; k<=x; k++)
  14.         {
  15.              cout<<"*";        
  16.         }
  17.                 x-=2;
  18.         cout<<endl;
  19.     }
  20.    
  21.     system("pause");
  22.     return 0;
  23. }
複製代碼

TOP

返回列表