Write a program that sorts and evaluates bridge hands.
The input is a stream of character pairs that represent playing cards. For example,
2C CD TC AD 6C 3D TD 3H 5H 7H AS JH KB
represents the 2 of clubs, queen of diamonds, 10 of clubs, acc of diamonds, and so on. Each pair consists of a rank followed by a suit, where rank is A, 2,.... 9, T, J, Q, or K, and suit is C, D, H, or S. You can assume that each input line represents exactly 13 cards and is error-free. Input is terminated by an end-of-filc.
For each line of input, form a hand of 13 cards. Display each hand in a readable form arranged both by suits and by rank within suit (aces are high). Then evaluate the hand by using the following standard bridge values:
Aces count 4
Kings count 3
Queens count 2
Jacks count 1
Voids (no cards in a suit) count 3
Singletons (one card in a suit) count 2
Doublctons (two cards in a suit) count 1
Long suits with more than 5 cards in the suit count 1
for each card over 5 iu number
For example, for the previous sample input line, the program should produce the output
because there are 2 acts, 1 king, 1 queen, 1 jack, 1 singleton, no doubletons, and no long suits. (The singleton ace of spades counts as both an ace and a singleton.)
Optional: S ee how much more flexible and fail-safe you can make your program. That is, try to remove as many of the previous assumptions in input as you can.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.