对一个英文句子统计每个单词出现的次数。
提示用户选择(1:按出现次数降序排列, 2:按单词字典顺序升序排列),显示排序结果,单词统一转换成为小写,输出格式参考例子。
英文句子中可能包含的标点符号有:,.;:
要求:
1 排除掉单词后面的逗号、分号、冒号
2 统计次数时,不区分大小写。
3 英文句子直接写在程序当中。
例如,英文句子为
The president told the audit authorities to keep their thoughts and actions in line with the CPC Central Committee, resolutely safeguard the centralized and unified leadership of the committee and implement the requirements of the committee.
则程序输出为:
按出现次数降序排列:
the,7
and,3
committee,3
of,2
actions,1
audit,1
authorities,1
central,1
centralized,1
cpc,1
implement,1
in,1
keep,1
leadership,1
line,1
president,1
requirements,1
resolutely,1
safeguard,1
their,1
thoughts,1
to,1
told,1
unified,1
with,1
按单词字典顺序升序排列:
actions,1
and,3
audit,1
authorities,1
central,1
centralized,1
committee,3
cpc,1
implement,1
in,1
keep,1
leadership,1
line,1
of,2
president,1
requirements,1
resolutely,1
safeguard,1
the,7
their,1
thoughts,1
to,1
told,1
unified,1
with,1
è¯ç¼å代ç å¦ä¸ï¼
#include<stdio.h>å®é è¿è¡æªå¾ï¼
大哥,我要的是c,不是c++。。。
追答要纯C语言版,私聊。
本回答被网友采纳