Write a program using integers user_num
and x
as input, and output user_num
divided by x
three times.
前任:
If the input is:
2000
2
然后输出是:
1000 500 250
Note: In Python 3, integer division discards fractions. Ex: 6 // 4 is 1 (the 0.5 is discarded).
这是我的代码:
user_num = int(input())
x = int(input())
for i in range(3):
user_num/= x
print (int(user_num), end=' ')
我只需要添加一个结束行,输出为 250。
原文由 Adam Dickenson 发布,翻译遵循 CC BY-SA 4.0 许可协议