满意答案
3323908z
2013.09.07
采纳率:58% 等级:12
已帮助:6408人
不知道你的连续3个Q是在30个字符以后输入还是在30个字符中,所以,我选个简单的写写,呵呵。用c++写了。
#include
#include
using namespace std;
void main()
{
string str;
while(cin>>str)
{
if(str=="QQQ") break;
int len=str.length ();
int numA,numB,numC;
numA=numB=numC=0;
for(int i=0;i
{
if(str.at (i)=='a' || str.at (i)=='A') numA++;
if(str.at (i)=='b' || str.at (i)=='B') numB++;
if(str.at (i)=='c' || str.at (i)=='C') numC++;
}
cout<
}
}
00分享举报