返回列表 發帖

進階-圖形練習

本帖最後由 陳品肇 於 2018-10-20 12:00 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     for(int i=1;i<=7;i++)
  7.     {
  8.        if(i<4)
  9.        {         
  10.           for(int x=1;x<=i;x++)
  11.           {
  12.             cout<<" ";
  13.           }     
  14.        }else
  15.        {
  16.           for(int x=7;x>=i;x--)
  17.           {
  18.             cout<<" ";
  19.           }   
  20.        }
  21.       
  22.         for(int x=1;x<=10;x++)
  23.         {
  24.              cout<<"*";        
  25.         }
  26.        cout<<endl;
  27.    }
  28.    

  29.    system("pause");
  30.    return 0;
  31. }
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

返回列表