• [C] Count Letters

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Here is a rectangular with n * m integers that there are n lines and each line has m letters.
    Can you help me to count how many of appeared each letters.

  • 输入
  • Input until EOF.
    First line will contain two integers n and m(1 <= n, m <= 100).
    Then will be a rectangular with n * m integers that there are n lines and each line has m integers.
    All letters are only from 'A' to 'Z'.
  • 输出
  • Print the answer, the appeared letters and the number of times this letter appears from small to large.
    Don't output the letters which has not appeared.
  • 样例输入
  • 3 4
    ABCD
    AAAA
    CCCE
    
  • 样例输出
  • A 5
    B 1
    C 4
    D 1
    E 1
    
  • 提示
  • 来源
  • Hungar
  • 操作

显示春菜