李白打酒加强版python
时间: 2023-12-25 18:29:56 浏览: 79
python编程解决李白买酒的问题
以下是李白打酒加强版的Python代码:
```python
def calculate_wine(original_wine):
wine = original_wine
count = 0
while True:
if wine == 0:
break
elif wine % 5 == 0:
wine = wine // 5 * 4
count += 1
elif wine 2 == 0:
wine = wine // 2
count += 1
else:
break
return
original_wine = int(input("请输入酒壶中原有酒的斗数:"))
result = calculate_wine(original_wine)
print("壶中原有酒的斗数为:", result)
```
阅读全文