码迷,mamicode.com
首页 > 其他好文 > 详细

Codeforces Round #369 (Div. 2)

时间:2016-09-12 14:11:25      阅读:89      评论:0      收藏:0      [点我收藏+]

标签:

A

#include <iostream>
#include <vector>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;
typedef unsigned long long ull;
char a[1050][5];
int main()
{
 //freopen("input.txt","r",stdin);
 //freopen("output.txt","w",stdout);
  int x;
  cin >> x;
  char c;
  int pop=0;
  for(int i=0;i<x;i++)
  {
    for(int j=0;j<5;j++)
    {
     scanf("%c",&c);
     if(c>=65)
     {
      a[i][j]=c;
     }
     else
     j--;
    }
  }
  /*for(int i=0;i<x;i++)
  {
    for(int j=0;j<5;j++)
    {
     cout << a[i][j];
    }
  }*/
  for(int i=0;i<x;i++)
  {
    if(a[i][0]==‘O‘&&a[i][1]==‘O‘)
    {
     pop=1;
     a[i][0]=a[i][1]=‘+‘;
     break;
    }
    if(a[i][3]==‘O‘&&a[i][4]==‘O‘)
    {
     pop=1;
     a[i][3]=a[i][4]=‘+‘;
     break;
    }
  }
  if(pop==0)
  printf("NO");
  else
  {
      printf("YES");
    for(int i=0;i<x;i++)
  {
    printf("\n");
    for(int j=0;j<5;j++)
    {
     printf("%c",a[i][j]);
    }
  }
  }
 //fclose(stdin);
 //fclose(stdout);
}

  

Codeforces Round #369 (Div. 2)

标签:

原文地址:http://www.cnblogs.com/Aragaki/p/5864340.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!