The code is here,
#include<stdio.h>
int main(){
char str1[3], str2[3];
int t, i, b, o;
scanf("%d", &t);
while(t--){
scanf("%s", str1);
scanf("%s", str2);
b = o = 0;
for(i=0; i<3; i++){
if(str1[i] == 'b' || str2[i] == 'b')
b++;
else if(str1[i] == 'o' || str2[i] == 'o')
o++;
}
if(b > 1 && o > 0)
printf("yes\n");
else
printf("no\n");
}
return 0;
}
It passes all the 3 example cases given.