Back to Category
t002: Hangman (猜字遊戲)
Keyword: Basic_IO, leeg

Difficulity: 5 | Test Data Sets: 6 (Hidden) | Judging: Traditional Judge
Accepted : 67 Times | Submit :316 Times | Clicks : 1689
Accepted : 24 Users | Submit : 55 Users | Accepted rate : 44%
Time Limit :1000 ms | Memory Limit : 64000 KBytes
Update : 2015-03-09 09:49

Content: Chinese(TW) | English

Hangman is a game of word guessing.  Given a secrete word (less than 15 characters) to be guessed.  The player is to guess one character at a time, until the secrete word is revealed.  Please write a program to determine if the secrete word is guessed in the allowed number of guesses.

Input:

Hangman is a game of word guessing.  Given a secrete word (less than 15 characters) to be guessed.  The player is to guess one character at a time, until the secrete word is revealed.  Please write a program to determine if the secrete word is guessed in the allowed number of guesses.

Output:

For each test case, output the guesses in sequence until the entire word is revealed.  If the secrete word is not revealed, then output “NO SOLUTION”.  All output are to be in upper case letters.

Sample Input:help

若題目沒有特別說明,則應該以多測資的方式讀取,若不知如何讀取請參考 a001 的範例程式。
Hangman                                                ← beginning of test case 1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
HANG TEN                                             ← beginning of test case 2
QWERTYUIOPLKJHGFDSAZXCVBNM
computer                                               ← beginning of test case 3
QAZXSWEDCVFRTG

Sample Output :

ABCDEFGHIJKLMN
QWERTYUIOPLKJHGFDSAZXCVBN
NO SOLUTION

Hint :

Test case 1: Secret Word and guessed characters are all given in Uppercase letters.

Test case 2: Secret Word can be given in Lowercase letters.

Test case 3: Secret Word may contain blanks (to be ignored)

Test case 4-6: mixed of different secret words. 

Author :

leeg

  Solve it!   Status Forum

C
C++
JAVA
PASCAL
58075. dishomer
(1ms, 750KB, 1357B)

Program running time may be affected by various factors. Check server system environment information here