Promi_38

cf 1301A

Jan 17th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6.     int t, i;
  7.     scanf("%d", &t);
  8.    
  9.     while(t--)
  10.     {
  11.         char a[105], b[105], c[105];
  12.         scanf("%s %s %s", a, b, c);
  13.        
  14.         int f = 0;
  15.         for(i = 0; i < strlen(a); i++)
  16.         {
  17.             if(c[i] != a[i] && c[i] != b[i])
  18.             {
  19.                 f = 1;
  20.                 printf("NO\n");
  21.                 break;
  22.             }
  23.         }
  24.         if(f == 0) printf("YES\n");
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment