利用指针 求字符串中大写字母个数
void sumA(char *str,int count)
{
char * p = str;
int n = 0;
for (int i = 0; i < count; i++)
{
if (*(p+i)>='A' && *(p+i)<='Z')
{
n ++;
}
}
printf("大写字母个数为:%d\n",n );
}
int main()
{
char str[]="Hello World!";
sumA(str,sizeof(str));
return 0;
}