首页 > 其他 > 详细

897A. Scarborough Fair# 斯卡布罗集市(模拟)

时间:2017-12-17 15:40:25      阅读:215      评论:0      收藏:0      [点我收藏+]

题目出处:http://codeforces.com/problemset/problem/897/A

题目大意:将某个范围内的某个字符换成另外一个字符

#include<iostream>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    string s;
    cin>>s;
    while(m--){
        int l,r;
        char in,out;
        cin>>l>>r>>in>>out;
        for(int i=l-1;i<r;i++)    if(s[i]==in)    s[i] = out;
    }
    cout<<s;
    return 0;
}

 

897A. Scarborough Fair# 斯卡布罗集市(模拟)

原文:http://www.cnblogs.com/hello-OK/p/8052086.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!