4.4 do-while 迴圈(補充)
while 迴圈先檢查條件再執行。如果你想至少執行一次,再檢查條件(例如玩遊戲時「先玩一局,再問要不要繼續」),就用 do-while。
do-while 迴圈的結構:
Log in to read the full content
The syntax book is free for every AACPOJ account. Signing up takes a minute.
while 迴圈先檢查條件再執行。如果你想至少執行一次,再檢查條件(例如玩遊戲時「先玩一局,再問要不要繼續」),就用 do-while。
do-while 迴圈的結構:
Log in to read the full content
The syntax book is free for every AACPOJ account. Signing up takes a minute.