Halve the Number


Submit solution

Points: 45 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

題目說明

請撰寫一個程式,從使用者輸入的正整數開始,依序將數字除以 2(使用整數除法),並輸出每次的結果,直到數字小於等於 2 為止。

輸入

一個正整數(大於等於 2)。

輸出

從輸入的數字開始,依次輸出每次除以 2 的結果,直到數字小於等於 2。每個結果各占一行。

範例輸入 #1

32

範例輸出 #1

32
16
8
4
2

範例輸入 #2

100

範例輸出 #2

100
50
25
12
6
3
1

Comments

There are no comments at the moment.