1183: 字符统计
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:7
Solved:2
Description
输入多行英文文本,统计所有字母出现的频率、行数和单词数,然后按字母顺序输出其柱形统计图。具体样式详见样例
统计字母时不区分大小写
统计单词时以空格区分单词
统计字母时不区分大小写
统计单词时以空格区分单词
Input
任意行英文文本
Output
首先分行输出单词数与行数,
然后按字母顺序输出其出现的次数的柱形图,
柱形图以#号表示,每个“柱”之间相差一个空格
具体样式详见样例
然后按字母顺序输出其出现的次数的柱形图,
柱形图以#号表示,每个“柱”之间相差一个空格
具体样式详见样例
Sample Input Copy
As food is to the body, so is learning to the mind.
Our bodies grow and muscles develop with the intake of adequate nutritious food.
Likewise, we should keep learning day by day to maintain our keen mental power and expand our intellectual capacity.
Constant learning supplies us with inexhaustible fuel for driving us to sharpen our power of reasoning, analysis, and judgment.
Learning incessantly is the surest way to keep pace with the times in the information age, and an infallible warrant of success in times of uncertainty.
Sample Output Copy
89
5
#
#
#
#
#
#
#
# #
# #
# #
# # #
# # # #
# # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # #
# # # # # # # #
# # # # # # # # #
# # # # # # # # # #
# # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # # #
# # # # # # # # # # # # #
# # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # #
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
HINT
gets函数由于不安全,被许多编译器禁用。一般可使用fgets函数代替gets进行整行输入。
fgets函数有三个参数,第一个参数是存储输入内容的变量,第二个参数是读入字符的最大数量,第三个参数填stdin。
如fgets(s,1000,stdin);
fgets函数有三个参数,第一个参数是存储输入内容的变量,第二个参数是读入字符的最大数量,第三个参数填stdin。
如fgets(s,1000,stdin);