2016_8_20
题目思路很简单,手生了,太久没写代码了,加油
ac code
# -*- coding: utf-8 -*-
"""
Spyder Editor
author hanzy
This is a temporary script file.
"""
def ifdouble(a):
if a%2 == 0:
return 1
else:
return 0
if __name__ == "__main__":
num = input()
time = 0
while(num > 1):
if(ifdouble(num) == 0):
num = (3*num+1)/2
time += 1
else:
num = num/2
time += 1
print time