Advertisement
ABED160105

CODE

Oct 20th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.     int i ;
  9.     char input1[1000000] ;
  10.     cin>>i;
  11.     while(i--)
  12.     {
  13.         cin>>input1;
  14.         int n = strlen(input1);
  15.         char input2[n];
  16.         cin>>input2;
  17.         for(int j=0; input1[j]!='\0'; j++)
  18.         {
  19.             if(input1[j]=='W'&&input2[j]=='W')
  20.             {
  21.                 cout<<"B";
  22.             }
  23.             else if (input1[j]=='B'&&input2[j]=='B')
  24.                 cout<<"W";
  25.             else cout<<"B";
  26.         }
  27.         cout<<endl;
  28.     }
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement