arrow_forward
همه ارسالها
جزئیات ارسال کد#224
برای پسندیدن وارد شوید
1bounce = 1
2ball = int(input())
3
4
5while ball > 1:
6 if (ball / 2).is_integer():
7## print(f"Cut {ball} in half")
8 bounce += 1
9 ball = int(ball / 2)
10 else:
11 potential_services = iter(range(ball - 1, 0, -1))
12 service = next(potential_services)
13 if (ball ** 0.5).is_integer():
14 ball = int(ball ** 0.5)
15## print(f"{ball ** 2} Has a sqrt of {ball}")
16 else:
17 while True:
18 if not bool(ball % service):
19 bounce += 1
20 ball = service
21## print(f"service {ball}")
22 break
23 service = next(potential_services)
24
25
26print(bounce)
کد ارسالشده برای داوری خودکار هاتکدز
UTF-8