a052: Pokers 撲克牌大小
標籤 : 迴圈
通過比率 : 100% (11 人 / 11 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-04-09 08:57

內容

There are many kinds of game for playing cards. Now you will participate in the game. You will get several cards. Each card has a suit-spades >hearts>diamonds>clubs, and a rank. We decide which one is greater between two cards according to their suits. If their suits are the same, then compare their ranks.

 

撲克牌的遊戲有很多種,像是大老二、撿紅點等。然而,現在您要參與的是比大小遊戲,每張牌各有其花色和數字,大小比較主要以花色為主,黑桃>紅心>方塊>梅花;倘若花色相同時,則比較數字。

輸入說明

The first line of the input contains an integer n (1 ≤ n ≤ 50) indicating the number of test cases. For each test case, there is a line with several cards separated by a space. S, H, D, and C represent spades, hearts, diamonds, and clubs, respectively

 

第一列的整數n ( 1 ≤ n ≤ 50),代表撲克牌的n疊,其後有n列,每列即為一疊牌的內容,每張牌分別以英文、數字作表示,其中S代表黑桃、H代表紅心、D代表方塊、 C代表梅花。每筆資料分別以空白隔開。

輸出說明

Output the sorted cards and add a “new line character” in the end of output.

印出排列過後的撲克牌。一行是一疊牌,每張牌以空白隔開,最後必須有換行字元。

範例輸入
4
H5 D4 S2 C13 
D8 S3 D10 C12 H7 
H6 S3 
C5 D11 S1
範例輸出
S2 H5 D4 C13 
S3 H7 D10 D8 C12 
S3 H6 
S1 D11 C5
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
迴圈
出處:
ITSA_52th [編輯 :
shengZJ (shengZJ)
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」