arrow_forward
همه ارسالها
جزئیات ارسال کد#223
برای پسندیدن وارد شوید
1bounce = 1
2ball = int(input())
3
4
5while ball > 1:
6 if (ball / 2).is_integer():
7 bounce += 1
8 ball = int(ball / 2)
9 else:
10 potential_services = iter(range(ball - 1, 0, -1))
11 service = next(potential_services)
12 while True:
13 if not bool(ball % service):
14 bounce += 1
15 ball = service
16 break
17 service = next(potential_services)
18
19
20print(bounce)
کد ارسالشده برای داوری خودکار هاتکدز
UTF-8