Advertisement
rengetsu

Codeforces_711A

Jul 12th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. //Codeforces 711A
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int n;
  10.     bool rez = false;
  11.     cin >> n;
  12.     char mass[n][n];
  13.     for( int i = 0; i < n; i++ )
  14.     {
  15.         for( int y = 0; y < 5; y++ )
  16.         {
  17.             cin >> mass[i][y];
  18.         }
  19.     }
  20.     for( int i = 0; i < n; i++ )
  21.     {
  22.         for( int y = 0; y < 5; y++ )
  23.         {
  24.             if( mass[i][y] == 'O' && mass[i][y+1] == 'O' && rez == false )
  25.             {
  26.                 mass[i][y] = '+';
  27.                 mass[i][y+1] = '+';
  28.                 rez = true;
  29.             }
  30.         }
  31.     }
  32.     if( rez == true )
  33.     {
  34.         cout << "YES" << endl;
  35.         for( int i = 0; i < n; i++ )
  36.         {
  37.             for( int y = 0; y < 5; y++ )
  38.             {
  39.                 cout << mass[i][y];
  40.             }
  41.             cout << endl;
  42.         }
  43.     }
  44.     else{cout << "NO" << endl;}
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement