while循环会,for循环怎么写
jg = 99999
n = 0
while n < 5:
n+=1
s = int(input('输入价格:'))
if s > jg:
print('大')
elif s < jg:
print('小')
else:
print('ok')
break
if n>=5:
print('没机会')
while循环会,for循环怎么写
jg = 99999
n = 0
while n < 5:
n+=1
s = int(input('输入价格:'))
if s > jg:
print('大')
elif s < jg:
print('小')
else:
print('ok')
break
if n>=5:
print('没机会')
jg = 99999
for i in range(5):
s = int(input('输入价格:'))
if s > jg:
print('大')
elif s < jg:
print('小')
else:
print('ok')
break
else:
print('没机会')