1.1006 换个格式输出整数 (15分)
str=int(input())
def func(str):
n_1
=str//100
n_2
=(str-100*n_1
)//10
n_3
=str%10
print('B'*n_1
,end
='')
print('S'*n_2
,end
='')
for i
in range(n_3
):
print(i
+1,end
='')
func
(str)
2.1001 害死人不偿命的(3n+1)猜想 (15分)
num
=int(input("请输入:"))
count
=0
while num
!=1:
if(num
%2==0):
num
=num
/2
else:
num
=(3*num
+1)/2
count
+=1
print(count
)
转载请注明原文地址:https://tech.qufami.com/read-22554.html