Beginner Exercises – Patient Game

Posted by : MOnsDaR | Sonntag, 22. August 2010 | Published in

Another one from Bazzy on cplusplus.com. Its original name was “While( user == gullible )”.

The program asks the user to enter any number but a special one. If the user finally enters the special number, a message will put out, praising the user if he was very patient. (If the user has done the game more than 10 times)

Example output:

Do NOT enter 1: 2
Do NOT enter 2: 3
Do NOT enter 3: 4
Do NOT enter 4: 5
Do NOT enter 5: 6
Do NOT enter 6: 7
Do NOT enter 7: 8
Do NOT enter 8: 9
Do NOT enter 9: 0
Do NOT enter 10: 11
Do NOT enter 11: 11

Wow, you were very patient.
You did the game 11 times

Solution

(0) Comments

Leave a Response