Guest User

Untitled

a guest
Aug 30th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     char ch[1005][6];
  6.     int n,i,j,res,f=0;
  7.     cin>>n;
  8.     for(i=0; i<n; i++)
  9.     {
  10.         for(j=0; j<5; j++)
  11.         {
  12.             cin>>ch[i][j];
  13.         }
  14.             if(ch[i][0]=='O'&& ch[i][1]=='O' && f==0)
  15.             {
  16.                 ch[i][0]='+';
  17.                 ch[i][1]='+';
  18.                 f=1;
  19.             }
  20.             else if(ch[i][3]=='O'&&ch[i][4]=='O'&& f==0)
  21.             {
  22.                 ch[i][3]='+';
  23.                 ch[i][4]='+';
  24.                 f=1;
  25.             }
  26.     }
  27.  
  28.     if(f==1)
  29.     {
  30.         cout<<"YES"<<endl;
  31.         for(i=0; i<n; i++)
  32.         {
  33.             for(j=0; j<5; j++)
  34.                 cout<<ch[i][j];
  35.             cout<<endl;
  36.         }
  37.     }
  38.     else
  39.         cout<<"NO"<<endl;
  40.  
  41.  
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment