Write a program that asks the user to enter the number of push-ups they can do. The program should force the user to enter a valid number by repeating the question until a number between 0 and 500 is entered. Once a valid answer is provided, the program should print out: “Wimp!! I can do X.” where X is one more that what the user entered.
这是贝壳所展示的:
How many push-ups can you do? 1000
Liar, please enter a number between 0 and 500: 2341
Liar, please enter a number between 0 and 500: 75
Wimp!! I can do 76.
这应该可以做到:
相关问题 更多 >
编程相关推荐