Source File:
Input File: PROBLEMB.DAT
Description:
Professor Clueless needs help playing the Yathzee dice game with his daughter. He realizes that there are 5 six sided dice, but after he has rolled them, he can't distinguish a long straight from a full house. Your task is to identify the best use of each group of five dice values in the input.
The input will consist of groups of five dice values where each die has the integer value 1 to 6 inclusive. You should ignore values that are outside that range (with a message stating you are ignoring it). Continue reading groups of 5 dice values until an attempt to read an integer fails. For each group of dice, print the best use of that group of dice.
Possible uses listed from best to worst are:
e.g. 6 4 5 3 2 has long straight: 2 3 4 5 6
e.g. 6 4 1 3 2 contains short straight: 1 2 3 4
e.g. 4 4 4 4 4 has five of a kind: 4
e.g. 6 5 6 6 6 has four of a kind: 6
e.g. 5 4 4 5 4 has full house: 4 5
e.g. 3 4 5 5 5 has three of a kind: 5
e.g. 4 5 2 5 2 has two pair: 5 2
e.g. 6 3 4 2 6 has two of a kind: 6
e.g. 5 3 6 1 2 has nothing
| Sample Input | Sample Output |
|---|---|
| 4 5 3 6 4 | short straight: 3 4 5 6 |
| 6 3 2 3 2 | two pair: 3 2 |
| 3 2 3 2 3 | full house: 3 2 |
| 6 3 1 2 5 | nothing |
| 1 1 1 1 4 | four of a kind: 1 |
| 2 8 5 2 5 5 | Invalid 8, ignored. full house: 5 2 |