#13339: 求解這樣哪裡有問題 會卡2.3測資點


970003@mjes.tp.edu.tw (ズイ₍₍(ง˘ω˘)ว⁾⁾ズイ)

學校 : 臺北市立萬芳高級中學
編號 : 72661
來源 : [112.104.142.115]
最後登入時間 :
2021-02-02 01:42:00

# -*- 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
#13341: Re:求解這樣哪裡有問題 會卡2.3測資點


anandrewboy70900 (ShowTsai)

學校 : 國立中央大學
編號 : 27736
來源 : [203.204.218.144]
最後登入時間 :
2025-05-29 22:24:26

實測是這樣就過了:
s = s.strip() if s == "": continue
可能測資中間會有空行吧




#13343: Re:求解這樣哪裡有問題 會卡2.3測資點


970003@mjes.tp.edu.tw (ズイ₍₍(ง˘ω˘)ว⁾⁾ズイ)

學校 : 臺北市立萬芳高級中學
編號 : 72661
來源 : [112.104.142.115]
最後登入時間 :
2021-02-02 01:42:00

實測是這樣就過了:
s = s.strip() if s == "": continue
可能測資中間會有空行吧





感恩 我AC了 以後有這種問題我會嘗試看看