本帖最後由 tonyh 於 2019-7-6 10:28 編輯
利用巢狀迴圈, 試做一個長為10顆*, 高為4顆*, 之平行四邊形, 排列如下圖:
![](https://seed.istak.org.tw/attachment.php?aid=MTI0Mnw5NThiNjM3N3wxNDc3NzI0MDYwfDcwMDR4RWd4Mm1sMWpwZUh6aUxFa3R2MVM4eWd5dUErZm55a0wvSm1idEpMOXo4&noupdate=yes) - #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- for(_____________)
- {
- for(_____________)
- {
- cout<<" ";
- }
- for(_____________)
- {
- cout<<"*";
- }
- cout<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼本帖隱藏的內容需要回復才可以瀏覽 |