#include <iostream>
using namespace std;
int c1=0,c2=0;
int b1=0,b2=0;
int jj1=0,jj2=0;
void cmp(char a,char b)
{
if(a=='C'&&b=='J')c1++;
else if(a=='C'&&b=='B')b2++;
else if(a=='B'&&b=='C')b1++;
else if(a=='B'&&b=='J')jj2++;
else if(a=='J'&&b=='C')c2++;
else if(a=='J'&&b=='B')jj1++;
}
int main()
{
int n;
cin>>n;
getchar();
char a[10];
int t=0;
int nn = n;
while (nn--)
{
char x,y;
cin.getline(a,10);
if(a[0]==a[2])
{
t++;
continue;
}
else cmp(a[0],a[2]);
}
char max1= 'B';
int m1 = b1;
char max2 = 'B';
int m2 = b2;
if(m1<c1){max1 = 'C';m1=c1;}
if(m1<jj1){max1 = 'J';m1 = jj1;}
if(m2<c2){max2 = 'C';m2=c2;}
if(m2<jj2){max2 = 'J';m2=jj2;}
cout<<c1+b1+jj1<<" "<<t<<" "<<n-t-(c1+b1+jj1)<<endl;
cout<<c2+b2+jj2<<" "<<t<<" "<<n-t-(c2+b2+jj2)<<endl;
cout<<max1<<" "<<max2;
return 0;
}
PAT乙级 1018 锤子剪刀布
最新推荐文章于 2023-12-16 16:09:17 发布