4433: 【Python基础】猜数游戏1.0

Memory Limit:128 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:794 Solved:326

Description

小明通宵编程,终于完成了猜数游戏的程序设计!但由于太困了,不小心把程序前面的缩进全部删除,请帮他改回来,谢谢大家! ### 参考程序 number = int(input("请输入被猜的数字:")) guess = int(input("请猜一个1~100的数:")) while guess != number:#猜不中 if guess > number:#猜的数字太大 print("太大了!") else: print("太小了!") guess = int(input("请继续猜数:")) print("你真棒,猜中了!") ### 提示 1、行末冒号,下一行缩进;同级语句缩进对齐。 2、一个Tab为4个空格,Shift+Tab可以删除缩进。 ```flow o=>start: 开 始 p=>end: 结 束 a=>operation: s = i = 0 b=>condition: guess != number|hide c=>condition: guess > number|hide x=>inputoutput: 输出:太大了 y=>inputoutput: 输出:太小了 s=>inputoutput: 输入要猜的数字 t=>inputoutput: 继续输入猜的数字 e=>inputoutput: 输出Well Done o->a->s->b b(yes, right)->c b(no)->e->p c(yes, right)->x->t c(no)->y->t t(left)->b ```

Input

第一行:一个整数。 接下来若干行,每行一个整数。

Output

输出回答。

Sample Input Copy

63
50
70
60
65
63
66

Sample Output Copy

请输入被猜的数字:请猜一个1~100的数:太小了!
请继续猜数:太大了!
请继续猜数:太小了!
请继续猜数:太大了!
请继续猜数:你真棒,猜中了!

加入题单

算法标签: