题解 | #字符的个数#
字符的个数
https://www.nowcoder.com/practice/dc28f2bf113a4058be888a5875206238
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int a{},b{},d{};
for (char c : s) {
if (c=='a') {
a+=1;
}
if (c=='b') {
b+=1;
}
if (c=='c') {
d+=1;
}
}
cout<<a<<" "<<b<<" "<<d<<endl;
return 0;
{
}
}
