a077: Sip-Pat-La 18 啦遊戲設計
標籤 :
通過比率 : 67% (2 人 / 3 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2020-04-16 11:59

內容

" Sip-Pat-La" is one of the popular dice games in Taiwan.

Players roll four dice in the game and score the results. There are three conditions:

  1. Win-take-all: Four dice have the same number;
  2. Meaningless: Four dice have different numbers, or three dice have the same number;
  3. Score: Two dice have the same number; the score is the sum of the rest two dice. If the four numbers are two pairs, select the pair with the bigger number to calculate the score.

Please write a program and input the four dice numbers respectively to judge the result.

 

有一種坊間常見的擲骰子遊戲稱為 "18 啦 "~

其玩法是玩家擲四個骰子來算分,會產生有三種結果:

1.通殺:四 顆骰子點數均相同;

2.無意義:三顆骰子點數相同,或四顆骰子點數均不相同;

3.計分:兩個骰子相同點數,分數即為另兩個骰子點數和;若四個骰子的點數兩兩相同形成兩對,分數選擇較多點數和的那一對骰子。

 

輸入說明

Enter the four numbers of dice points per line, where the numbers range from 1 to 6.

每行輸入四個骰出的點數,輸入的點數介於 1~6 之間 。

輸出說明

The results of each measurement are output in order. If it is a winner-take-all, the uppercase English letter WIN is displayed. If it is meaningless, the uppercase English letter R is displayed. If the points can be calculated, show the score. No spaces are required before and after the output, and there must be a newline character at the end.

依序輸出各筆測資的結果,若是通殺,則顯示大寫英文字母 WIN , 若是無意義 ,則顯示大寫英文字母 R ,若可計算點數,則顯示最後點數 。 輸出結果前後均不需留空格 ,最後必須有換行字元。

範例輸入
2
3
4
5	

3
4
3
4	
範例輸出
R

8
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (100%): 1.0s , <1K
提示 :
標籤:
出處:
[編輯 :
shengZJ (shengZJ)
]


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