题解
2025-01-13 17:04:48
发布于:江苏
4阅读
0回复
0点赞
#include<iostream>
#include<string>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
string n;
int A=0,B=0;
cin>>n;
for(int j=0;j<n.size();j++){
if(n[j]=='A'){
A++;
}else{
B++;
}
}
if(A>B){
cout<<'A'<<"\n";
}else{
cout<<'B'<<"\n";
}
}
return 0;
}
这里空空如也
有帮助,赞一个