a070: Letters 字母
標籤 : String 字串
通過比率 : 100% (9 人 / 9 人 ) (非即時)
評分方式 :
Tolerant

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

內容

Write a program to compute the number of different letters in a string

Your program should first read the string using scanf(), then compute the number of different letters in this string. Note that 'a' and 'A' are the same.

The output consists of 26 lines, and each line has the number of times that letter appears in the string.

撰寫一個程式來計算字串中不同字母的數量

您的程式首先應使用scanf()讀取字串,然後計算此字串中不同字母的數量。 請注意,'a'和'A'是相同的。

輸出由26行組成,每行包含字母在字串中出現的次數。

輸入說明

A single line contains a string without any space character (except the line feed character at the end).

The string's length is less then 100.

單行包含沒有任何空格字元的字串(末尾的換行符號除外)。

字串的長度小於100。

輸出說明

Output the number of times that each letter appears, each in a line.

輸出每個字母出現的次數,每個字母都在一行中。

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


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