00问答网
所有问题
c语言任意输入一个字符串,统计每个小写字母出现的次数并输出
c语言任意输入一个字符串,统计每个小写字母出现的次数并输出
举报该问题
其他回答
第1个回答 2018-05-17
int *LetterCount(const char *s)
{
int *num = (int*)malloc(sizeof(int)*26);
char ch;
memset(num, 0, sizeof(int)*26);
while( (ch=*s++) != '\0')
{
if( ch>='a' && ch<='z')
++num[ch-'a'];
}
return num;
}
本回答被网友采纳
相似回答
大家正在搜
相关问题
编写函数实现统计一个字符串中每个小写字母出现的次数。
c语言 对任意输入的字符串,统计其中的大写字母和小写字母的个...
从键盘上任意输出一个字符串,统计字符串中大小写英文字母出现的...
C语言编程:从键盘输入一个字符串。分别统计其中大写字母、小写...
C语言,输入一个字符串,统计重复出现某个字母的次数。
编程: 输入一个字符串,统计该字符串中每个字母出现的次数,并...
用C语言编写一个程序,输入一个字符串,统计其中各个字符出现的...
C语言编程:输入一串英文字母,统计每个字母(不区分大小写)出...