UVA-499 - What's The Frequency, Kenneth?

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 本題選為「20160524 大學程式能力檢定 CPE」題目。

題意概要

試求:每一行文字中「出現頻率最多」的大小寫英文字母,若有一樣多的字母,則按照 A - Z、a - z 的順序輸出。


Input

The input file consists of a lot of lines of text.


Output

A line of output should contain a list of letters that all occured with the highest frequency in the corresponding input line, followed by the frequency. The list of letters should be an alphabetical list of upper case letters followed by an alphabetical list of lower case letters.


Sample Input

When riding your bicycle backwards down a one-way street, if the
wheel falls of a canoe, how many ball bearings does it take to fill
up a water buffalo?
Hello Howard.

Sample Output

e 6
al 7
a 3
Hlo 2
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus