题解 | #字符的个数#
字符的个数
http://www.nowcoder.com/practice/dc28f2bf113a4058be888a5875206238
#include<iostream>
using namespace std;
int main(){
string s;
cin>>s;
int a=0,b=0,c=0;
for(int i=0; i<s.length(); i++){
if(s[i]=='a')
a++;
if(s[i]=='b')
b++;
if(s[i]=='c')
c++;
}
printf("%d %d %d",a,b,c);
return 0;
}