关于AC狗变成XHZ的题解
2025-07-11 22:29:19
发布于:江苏
6阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int a=0,b=0,c=0;
getline(cin,s);
for(int i=0;i<s.size();i++){
if(s[i]=='c'){
a++;
}else if(s[i]=='p'){
b++;
}else if(s[i]=='d'){
c++;
}
}
cout<<min(a,min(b,c/2));
return 0;
}
这里空空如也
有帮助,赞一个