B - Bonapity

 1 #include <cstdio>
 2 #include <cstring>
 3 int n;
 4 char str1[110],str2[110];
 5 void b(char s[])
 6 {
 7     int len=strlen(s);
 8     for(int i=0;i<len;i++)
 9     {
10         if(s[i]>='A'&&s[i]<='Z')
11             s[i]+=32;
12         if(s[i]=='p') s[i]=123;
13         if(s[i]=='b') s[i]=123;
14         if(s[i]=='e') s[i]=124;
15         if(s[i]=='i') s[i]=124;
16     }
17 }
18 int main()
19 {
20     scanf("%d",&n);
21     while(n--)
22     {
23         scanf("%s%s",str1,str2);
24         b(str1);
25         b(str2);
26         if(strcmp(str1,str2))
27             printf("No\n");
28         else printf("Yes\n");
29     }
30 }

 

posted @ 2017-07-20 22:53  Kearon  阅读(304)  评论(0编辑  收藏  举报