题解 | 数颜色
数颜色
https://www.nowcoder.com/practice/7f458453debe49c9a98f20f42d65ebf1
#include <iostream>
using namespace std;
#include <string>
int main() {
string s;
cin>>s;
int a=0,b=0,d=0;
for(char c:s){
if(c=='R')a++;
else if(c=='G')b++;
else d++;
}
cout<<"("<<a<<","<<b<<","<<d<<")"<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")
顺丰集团工作强度 382人发布