解题思路:
注意事项:
参考代码:
def f(x):
c=1
while x!=1:
if x%2==0:
x=x//2
else:
x=x*3+1
c+=1
return c
while True:
a,b=map(int,input().split())
print(a,b,end=' ')
mc=0
if a>b:
a,b=b,a
for i in range(a,b+1):
mc=max(f(i),mc)
print(mc)
0.0分
0 人评分
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)万恶的long long浏览:880 |
WU-图形输出 (C++代码)浏览:802 |
WU-输入输出格式练习 (C++代码)浏览:1082 |
WU-printf基础练习2 (C++代码)浏览:2007 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:576 |
Hello, world! (C++代码)浏览:1744 |
C语言考试练习题_保留字母 (C语言代码)浏览:713 |
C语言训练-数字母 (C语言代码)浏览:608 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:531 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:489 |