4.1 為什麼需要迴圈
迴圈就是「重複執行某段程式碼,直到某個條件不再滿足」。它的威力,是用短短幾行取代成百上千行的複製貼上。
回到「想像一下…」裡的情境題:印出 n 行 Hello, AACPSCHOOL!。先用中文寫出步驟:
Log in to read the full content
The syntax book is free for every AACPOJ account. Signing up takes a minute.
迴圈就是「重複執行某段程式碼,直到某個條件不再滿足」。它的威力,是用短短幾行取代成百上千行的複製貼上。
回到「想像一下…」裡的情境題:印出 n 行 Hello, AACPSCHOOL!。先用中文寫出步驟:
Log in to read the full content
The syntax book is free for every AACPOJ account. Signing up takes a minute.