poj3589 水题
2019-11-30 本文已影响0人
暖昼氤氲
/*
Time:2019.11.29
Author: Goven
type:水题
err:
ref:
*/
#include<iostream>
using namespace std;
int main()
{
int t;
char a[5], b[5];
cin >> t;
while (t--) {
cin >> a >> b;
int cnta = 0, cntb = 0;
for (int i = 0; i < 4; i++) {
if (a[i] == b[i]) cnta++;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (a[i] == b[j]) cntb++;
}
}
cntb -= cnta;
printf("%dA%dB\n", cnta, cntb);
}
return 0;
}