题解 | #字符的个数#
字符的个数
https://www.nowcoder.com/practice/dc28f2bf113a4058be888a5875206238
#include <iostream>
#include<string>
using namespace std;
int main(){
char str[1000000];
cin.getline(str,sizeof(str));
// write your code here......
int a,b,c;
a=0;
b=0;
c=0;
char *p =str;
while(*p !='\0' ){
if(*p=='a')
a++;
else if(*p=='b')
b++;
else ++c;
p++;
}
cout<<a<<" "<<b<<" "<<c;
return 0;
}
