Ankit_132

C

Jul 21st, 2023
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define ll     long long
  7. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  8.  
  9. int main()
  10. {
  11.     _test
  12.     {
  13.         vector<string> s(8);
  14.         for(auto &e: s)     cin>>e;
  15.  
  16.         string ans = "";
  17.  
  18.         for(int i=0; i<8; i++)
  19.         {
  20.             for(int j=0; j<8; j++)
  21.             {
  22.                 while(i<8 && s[i][j]!='.')
  23.                     ans += s[i++][j];
  24.  
  25.                 if(ans != "")       break;
  26.             }
  27.  
  28.             if(ans != "");
  29.         }
  30.  
  31.         cout<<ans<<"\n";
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment