https://codeforces.com/problemset/problem/711/A

正则表达式基本应用

#include<bits/stdc++.h>
using namespace std;
int n, i;
string s, t;
int main() {
//freopen("in.txt", "r", stdin);
cin >> n; while (n--)cin >> s, t += s + "\n";//将字符累加到一个大字符串中
i = t.find("OO");//也可以用match替换
if (i >= 0)t.replace(i, 2, "++"), cout << "YES" << endl << t;
else cout << "NO";
return 0;
}

Codeforce Problem 711A - Bus to Udayland (正则表达式)的更多相关文章

  1. 【模拟】Codeforces 711A Bus to Udayland

    题目链接: http://codeforces.com/problemset/problem/711/A 题目大意: N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符 ...

  2. CodeForces 711A Bus to Udayland (水题)

    题意:给定一个n*4的矩阵,然后O表示空座位,X表示已经有人了,问你是不能找到一对相邻的座位,都是空的,并且前两个是一对,后两个是一对. 析:直接暴力找就行. 代码如下: #pragma commen ...

  3. CodeForces 711A Bus to Udayland

    简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...

  4. codeforces 711A A. Bus to Udayland(水题)

    题目链接: A. Bus to Udayland 题意: 找一对空位坐下来,水; 思路: AC代码: #include <iostream> #include <cstdio> ...

  5. Codeforces Round #369 (Div. 2) A. Bus to Udayland 水题

    A. Bus to Udayland 题目连接: http://www.codeforces.com/contest/711/problem/A Description ZS the Coder an ...

  6. Codeforces Round #369 (Div. 2) A. Bus to Udayland (水题)

    Bus to Udayland 题目链接: http://codeforces.com/contest/711/problem/A Description ZS the Coder and Chris ...

  7. Codeforces Round #369 (Div. 2) A. Bus to Udayland【字符串/二维字符数组求连起来的座位并改为其他字符】

    A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  8. A. Bus to Udayland

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  9. 洛谷 题解 CF711A 【Bus to Udayland】

    先用一个字符数组存每行的座位情况(字符变量也可以) 接下来用另一个数组存最后的座位情况 好了,看代码 #include<iostream> using namespace std; boo ...

  10. Ural 1011. Conductors

    1011. Conductors Time limit: 2.0 secondMemory limit: 64 MB Background Everyone making translations f ...

随机推荐

  1. keepass

  2. 【题解】HD2016.X1,HD2016.X3,HD2016.X4,HD2016.X5

    [HD2016.X1] 价钱统计 题目描述 夏天到了,超市里摆满了各种各样的应季水果.现在知道:西瓜的价钱是每斤 1.2 元:桃子的价钱是每斤 3.5 元:葡萄的价钱是每斤 4.5 元:苹果的价钱是每 ...

  3. Vue项目的创建、运行与端口号修改

    前言:Vue-cli是Vue官方提供的一个脚手架,用于快速生成一个Vue的项目模板,依赖于NodeJS环境 NodeJS下载:NodeJS安装下载 Vue-cli下载:Vue-cli下载 一.Vue图 ...

  4. Ascii字符画 在线生成工具

    英文 http://patorjk.com/software/taag/ 点击 Test All 一键测试所有样式 目前有317种可选 个人常用格式 3D-ASCII ANSI Shadow Bulb ...

  5. 【C#】【WinForm】MDI窗体

    MDI窗体的相关学习使用 1.设置MDI父窗体 在属性中找到IsMdiContainer选项,设置为True 2.添加MDI子窗体,在项目中依次选择添加->窗体,然后一直默认即可 添加后的项目目 ...

  6. 我的大数据之路 - 基于HANA构建实时方案的历程

    产品内部前期有一个共识,依据业务要求的时效性来选择技术平台,即: 实时类业务,时效性小于2小时,则使用HANA构建. 离线类业务,时效性大于2小时,则使用大数据平台构建. 经过五月.六月两月的努力,离 ...

  7. 在macOS中搭建.NET MAUI开发环境

    @ 目录 准备 安装扩展 安装 .NET 安装工作负载 安装 Xcode 命令行工具 调试安卓应用 安装 JDK 安装 Android SDK 安装 Android 模拟器 安装模拟器 安装镜像 创建 ...

  8. STM32CubeMX教程3 GPIO输入 - 按键响应

    1.准备材料 开发板(STM32F407G-DISC1) ST-LINK/V2驱动 STM32CubeMX软件(Version 6.10.0) keil µVision5 IDE(MDK-Arm) 2 ...

  9. 在CentOS安装BIND,把所有DNS请求日志转发到syslog服务器去

    在CentOS安装BIND,把所有DNS请求日志转发到syslog服务器去 在vim /etc/named.conf里配置的内容 logging { channel default_debug { f ...

  10. Python笔记三之闭包与装饰器

    本文首发于公众号:Hunter后端 原文链接:Python笔记三之闭包与装饰器 这一篇笔记介绍 Python 里面的装饰器. 在介绍装饰器前,首先提出这样一个需求,我想统计某个函数的执行时间,假设这个 ...