Python的解法

JupHamaster 木星拜 2020-08-21 12:13:13 2020-09-13 17:21:59 15

用while(直接超时)

a = int(input())
s = 0
while a != 1:
    if a % 2 == 0:
        a /= 2
        s+=1
    else:
        a * 3 + 1
        s+=1
print(s)

nice!!

{{ vote && vote.total.up }}

共 6 条回复

wyh15 Minecraft

c++党拍手叫好

jsq 蒟蒻

c++党拍手叫好

Kinghero King of the summit

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

null him

c++党拍手叫好

2895008128 ZWY

没有必要用while循环,用其他方法也不是不可

root 站长

棒~