1 .已知系统生成一个数字num=58
2.用户共有5次机会猜;
3.如果用户猜测数字大于系统给出的数字,打印"too big"
4.如果用户猜测数字小于系统给出的数字,打印"too small"
5.如果用户猜错次数超过5次,打印"guess error more then 5 times,can not guess again"
6.如果用户猜测的数字等于系统给出的数字,打印"good".并退出循环
请补充以下程序,实现功能。
num=58
ans=int(input())
i=1
while i<=5 and ans!=num:
if
print('too big')
else:
print('too small')
ans=
i=
if
:
print('
guess error more then 5 times,can not guess again')
else:
print('good')