求各位帮忙修改,求字母个数
请大神帮忙修改这个程序求出一串英文中指定字母的个数,不区分大小写
程序代码:
#include "stdafx.h"
#include<stdio.h>
int count(char str[],char c)
{
int i,count;
count=0;
for(i=0;str[i]!='\0';i++)
{
while((str[i]=='c')||(str[i]=='c'+32))
count++;
}
printf("%d",count);
return 0;
}
int main()
{
char str[50];
char c;
printf("请输入一串英文");
scanf("%s",str);
printf("请输入要找的字母");
scanf("%c",&c);
count(str,c);
return 0;
}









