#include <iostream>
using namespace std;
int main() {
int N;
for(cin>>N;N;--N){
int digit[10]={0},A=0,B=0;
char x[5],y[5],*i,*j;
cin>>x>>y;
for(i=x,j=y;*i;++digit[*i-'0'],++i,++j) if(*i==*j) ++A;
for(i=x,j=y;*i;++i,++j) if(digit[*j-'0']&&*i!=*j) ++B;
cout<<A<<'A'<<B<<'B'<<endl;
}
return 0;
}
Saturday, 21 March 2009
POJ ( acm.pku.edu.cn ) 3589
水啊水啊
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment