a069: Counting the occurrences 計算出現次數
標籤 : String 字串
通過比率 : 100% (6 人 / 6 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-03-08 13:48

內容

Given a string, you are asked to find the character which occurs more times than any other character in the string.

給定一個字符串,您被要求找出在字串中出現最多次的字元。

輸入說明

The input consists of several lines, and each line is a string for one test case. Each string has no any space and its length is no more than 80 and at least one.

輸入由幾行組成,每行是一個測試用例的字串。 每個字串沒有任何空格,其長度不超過80且至少為1。

輸出說明

For each case, find the character and print it in one line. If there is no such character, output “None”.

對於每種情況,找到該字元並將其輸出在一行中。 如果沒有這樣的字元,則輸出“None”。

範例輸入
abcdEABCE
123abc1231%^&*
AA22
範例輸出
E
1
None
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
String 字串
出處:
線上協同學習平臺 - ITSA 教育部資通訊軟體創新人才推升計畫 [編輯 :
zero_jason (zero_jason(MANAGER))
]


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