c语言怎么编写统计一个字符串中各个字符的个数
c语言怎么编写统计一个字符串中各个字符的个数
日期:2017-05-23 17:56:57 人气:1
void getNum(char *str)
{int i,a[26]={0},A[26]={0};
for(;*str;str++)
if(*str>='A'&&*str<='Z')A[*str-'A']++;
else if(*str>='a'&&*str<='z')a[*str-'a']++;
for(i=0;i<26;i++)
if(A[i