我试图做在我的代码如下:代码不给任何输出
一名男子正试图拍摄一些气球的岩石。
a
是一行中的气球的数量。b
是男人试图用来拍摄的摇滚速度。c
是岩石撞击每个气球后失去的速度。
最后我想知道有多少气球被岩石击中。
问题是代码不想给我任何输出。请帮忙!
def Balloons(a, b, c):
d = 0
for i in (0, a):
b - c
d = d+1
if d == int(a):
print(d)
if d > int(a):
d = d-1
print(d)
if int(b) <= 0:
print(d)
x = int(input('give me the number of test cases: '))
for i in range (0, x):
a = int(input())
b = int(input())
c = int(input())
Balloons(a, b, c)
你错过了'范围'在'为我在(0,a)'? 'b - c'这行不会做任何事情。 –
当您从控制台输入时,请按下'enter'键为每个输入。 –