c语言中怎样统计字符串中包含英文字母的个数?
c语言中怎样统计字符串中包含英文字母的个数?
日期:2019-08-14 17:47:41 人气:3
c语言中要统计字符串中包含英文字母的个数可以参考以下内容:
main()
{
char str[100],*p;
int num[4],i;
p=str;
gets(str);
for(i=0;i<4;i++)
num[i]=0;
for(;*p!='\0';p++)
{
if((*p='a')||(*p='A')) num[0]++;
else if(*p==' ') num[1]++;
else if((*p='0&