Advertisement
Guest User

Contest rount 369A Bus to Udayland

a guest
Aug 30th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 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. if(ch[i][0]=='O'&&ch[i][1]=='O'&&f==0)
  14. {
  15. ch[i][0]='+';
  16. ch[i][1]='+';
  17. f=1;
  18. }
  19. else if(ch[i][3]=='O'&&ch[i][4]=='O'&&f==0)
  20. {
  21. ch[i][3]='+';
  22. ch[i][4]='+';
  23. f=1;
  24. }
  25.  
  26. }
  27. }
  28.  
  29. if(f==1)
  30. {
  31. cout<<"YES"<<endl;
  32. for(i=0; i<n; i++)
  33. {
  34. for(j=0; j<5; j++)
  35. cout<<ch[i][j];
  36.  
  37. cout<<endl;
  38. }
  39.  
  40.  
  41. }
  42. else
  43. cout<<"NO"<<endl;
  44.  
  45.  
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement