/*
*Copyright (c) 2014,烟台大学计算机学院
*All gight reserved.
*文件名称:temp.cpp
*作者:曾晓
*完成时间:2014年11月19日
*版本号:v1.0
*/
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char str[50];
int i=0,n=0;
cout<<"输入字符串:"<<endl;
gets (str);
while (str[i]!='\0')
{
if (str[i]=='A')
n++;
i++;
}
cout<<"其中A的个数为:"<<n<<endl;
return 0;
}
运行结果: