#include<stdio.h>
char a[100002][2];
int main(){
int i, j, n, jias=0, ping=0, yis=0;
int jiab=0, jiac=0, jiaj=0, yib=0, yic=0, yij=0;
char jia, yi;
scanf("%d",&n);
for(i=0;i<n;i++)
for(j=0;j<2;j++)
scanf("%s",&a[i][j]);
for(i=0;i<n;i++){
if(a[i][0]=='B'&&a[i][1]=='B')ping++;
if(a[i][0]=='B'&&a[i][1]=='J'){yis++;yij++;}
if(a[i][0]=='B'&&a[i][1]=='C'){jias++;jiab++;}
if(a[i][0]=='J'&&a[i][1]=='B'){jias++;jiaj++;}
if(a[i][0]=='J'&&a[i][1]=='J')ping++;
if(a[i][0]=='J'&&a[i][1]=='C'){yis++;yic++;}
if(a[i][0]=='C'&&a[i][1]=='B'){yis++;yib++;}
if(a[i][0]=='C'&&a[i][1]=='J'){jias++;jiac++;}
if(a[i][0]=='C'&&a[i][1]=='C')ping++;
}
printf("%d %d %d\n",jias,ping,yis);
printf("%d %d %d\n",yis,ping,jias);
if(jiab>=jiac)
if(jiab>=jiaj) printf("B");
else printf("J");
else if(jiac>=jiaj)printf("C");
else printf("J");
printf(" ");
if(yib>=yic)
if(yib>=yij) printf("B");
else printf("J");
else if(yic>=yij)printf("C");
else printf("J");
printf("\n");
return 0;
}
PAT-B1018
最新推荐文章于 2022-11-18 11:30:15 发布