489-hangman Judge
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem &problem=430
In ' Hangman Judge, the ' You are to write a-program that judges a series of hangman. For each game, the "answer to" puzzle is given as as the guesses. The Rules are the same as the classic game of Hangman, and are given as follows:
The contestant tries to solve to puzzle by guessing one letter at a time.
Every time a guess are correct, the characters in the word "match the Guess'll be" "turned over." For example, if your guess are ' o ' and the word is ' book ', then both ' O ' 's in the solution'll be counted as ' solved .''
Every time a wrong guess is made, a stroke would be added to the drawing of a hangman, which needs 7 strokes to complete. Each unique wrong guess only counts against the contestant once.
If the drawing of the hangman is completed before the contestant has successfully-guessed all the characters of the word, The contestant loses.
If The contestant has guessed the characters of the word before the drawing is complete, the contestant wins the game.
If The contestant does not guess enough letters to either win or lose, the contestant is out.
Your task as the ' Hangman Judge ' is to determine, for each game, whether the contestant wins, loses, or fails to finish A game.
Input
Your program would be given a series of inputs regarding the status of a game. All input to the lower case. The "a" of each of the same section would contain a number to indicate which round of the game is being played; The next line is the solution to the puzzle; The last line are a sequence of the guesses made by the contestant. A round number of -1 would indicate the end of all games (and input).
Output
The output of your program are to indicate which round of the game The contestant is currently playing as as as the Resul T of the game. There are three possible results:
You win.
You lose.
You are chickened out.
Sample Input
1
cheese
chese
2
cheese
abcdefg
3
cheese
abcdefgij
-1
Sample Output
Round 1
win.
Round 2
chickened out.
Round 3 You
lose.