Signed-off-by: sairate <sairate@sina.cn>

This commit is contained in:
sairate 2024-07-12 17:12:53 +08:00
parent 36ffc65018
commit 15bdf848b6
1 changed files with 13 additions and 0 deletions

13
角谷猜想.py Normal file
View File

@ -0,0 +1,13 @@
def jiaogu(n):
if n==1:
print("END")
return 1
if n%2==0:
print(n,"/",2,"=",n//2,sep="")
jiaogu(n//2)
else:
print(n, "*", 3, "+",1,"=", n*3+1, sep="")
jiaogu(n*3+1)
n=int(input())
jiaogu(n)