1001 害死人不偿命的(3n+1)猜想

https://pintia.cn/problem-sets/994805260223102976/problems/994805325918486528

n=int(input("please input the number:"))
i=0
while n!=1:
  if n%2==0:
    n=n/2
  else:
    n=(3*n+1)/2
  i+=1
print(i)

反思:1python3 没有raw_input了,都是input,注意输入的是默认string类型,可以用int ,float 进行格式变化

          2,input里放置面可以放置要输出的内容

原文地址:https://www.cnblogs.com/captain-dl/p/10133087.html