程式使用 While Loop 迴圈中的 i 值除以 2 後,取得其餘數來判斷燈亮或燈滅。餘數為 1 則燈亮,餘數為 0

則燈滅。

 

程式:

image

arrow
arrow
    全站熱搜

    iammic 發表在 痞客邦 留言(0) 人氣()