# -*- coding: utf8 -*-
import sys
for s in sys.stdin:
s = s.strip()
try:
a = int(s)
b = 0
while a != 1:
if a % 2== 0:
a = a//2
else:
a = a*3+1
b = b+1
print(b)
except EOFError:
break
實測是這樣就過了:
s = s.strip() if s == "": continue
可能測資中間會有空行吧
實測是這樣就過了:
s = s.strip() if s == "": continue
可能測資中間會有空行吧
感恩 我AC了 以後有這種問題我會嘗試看看