直接模拟或者KMP

 #include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;
const double pi=acos(-);
const int maxn=;
char s1[maxn],s2[maxn],s[maxn],c[maxn];
int main() {
// freopen("in.txt","r",stdin);
while(gets(s1)) {
int len1=strlen(s1);
for(int i=; i<len1; i++) {
if(s1[i]>='A'&&s1[i]<='Z')
s1[i]+=;
}
gets(s2);
int len2=strlen(s2);
gets(s);
int len=strlen(s),flag,flag1,k=;
for(int i=; i<len; i++) {
flag1=;
if(s[i]==s1[]||s[i]==s1[]-) {
int ii=i+;
flag=,flag1=;
for(int j=; j<len1; j++,ii++) {
if(s[ii]!=s1[j]&&s[ii]!=s1[j]-) {
flag=;
break;
}
}
}
if(!flag&&!flag1) {
for(int j=; j<len2; j++) {
c[k++]=s2[j];
}
i+=len1-;
}
else {
c[k++]=s[i];
}
}
for(int i=; i<k; i++) {
printf("%c",c[i]);
}
printf("\n");
}
return ;
}

FZU 2122 又见LKity的更多相关文章

  1. FZU 2122 ——又见LKity——————【KMP字符串匹配】

    Problem 2122 又见LKity Accept: 413    Submit: 1425Time Limit: 1000 mSec    Memory Limit : 32768 KB  Pr ...

  2. FZU 2122——又见LKity——————【字符串匹配、暴力】

    Problem 2122 又见LKity Accept: 407    Submit: 1413Time Limit: 1000 mSec    Memory Limit : 32768 KB  Pr ...

  3. FZU 2122 又见LKity【字符串/正难则反/KMP/把一个字符串中某个部分替换为另一个部分】

    嗨!大家好,在TempleRun中大家都认识我了吧.我是又笨又穷的猫猫LKity.很高兴这次又与各位FZU的ACMer见面了.最近见到FZU的各位ACMer都在刻苦地集训,整天在日光浴中闲得发慌的我压 ...

  4. FZU 2122 又见LKity(KMP+返回所有匹配位置)

    基础kmp应用,找到所有匹配位置即可 #include<stdio.h> #include<string.h> #include<algorithm> #inclu ...

  5. hust训练赛20160330--B - 又见LKity

    Problem 2122 又见LKity Time Limit: 1000 mSec Memory Limit : 32768 KB  Problem Description 嗨!大家好,在Templ ...

  6. FZU2122_又见LKity

    题目是说给你一个替换串和目标串.把一个长串中的所有的替换串替换为目标串而且不递归地替换. 很简单,直接做一次KMP然后直接替换. 注意替换后跳到替换串的尾部. 注意大小写的问题. #include & ...

  7. fzu 2122

    #include<stdio.h> #include<string.h> #define N 51000 char s1[200],s2[200],s[N]; int main ...

  8. FZU 2202——犯罪嫌疑人——————【思维题】

    犯罪嫌疑人 Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status ...

  9. 纪中20日c组T2 2122. 【2016-12-31普及组模拟】幸运票

    2122. 幸运票 (File IO): input:tickets.in output:tickets.out 时间限制: 1000 ms  空间限制: 262144 KB  具体限制 Goto P ...

随机推荐

  1. dataTable 禁止显示信息

    $("#id").DataTable({ "info": false, // 禁止显示信息 });

  2. C指针笔记

    指针的学习 两个数比较大小,通过传递内容进行比较 #include <stdio.h> void swap(int *p1, int *p2){ int temp; //注意指变量*的两个 ...

  3. Sersync实时同步企业应用配置实战

    一.实验环境 CentOS版本: 6.6(2.6.32.-504.el6.x86_64) Rsync版本:  Rsync-3.0.6(系统自带) Sersync版本:sersync2.5.4_64bi ...

  4. 开发软件设计模型 visual studio UML

    http://www.ibm.com/developerworks/cn/rational/rationaledge/content/feb05/bell/ http://msdn.microsoft ...

  5. 【实用技巧】文件MD5修改方法

    方法一 利用md5修改器   更新日志:2011-10-6 22:00修正对于路径中存在空格修改无效的bug2011-10-6 20:17更新:1.回归简约界面2.直接拖拽即可捕获地址3.一键修改文件 ...

  6. 25个App免费资源网站

    不少非常优秀的设计师已经在网络分享了很多出色的图标.界面 PSD 文件,再加上其他一些相关资源,设计 iOS 应用更加方便了. 模板 & PSDs  Icon Template Michael ...

  7. ping(1)

    /* ping program for learning IP protocol author: jeff date: 2014/10/25 */ #include <stdio.h> # ...

  8. Firefly 性能测试 报告

    原地址:http://bbs.gameres.com/thread_223724.html Firefly 性能测试 主要考虑点 网络IO的并发 进程间通信压力 数据读写压力 测试机配置: 操作系统 ...

  9. android 自定义按钮的外边框

    <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http: ...

  10. virsh console使用方法

    How to use virsh console virsh 是libvirt 开源函数库中的一个命令行工具,用来在命令行下通过libvirt发布管理虚拟机的各种命令,现在介绍一下其中一个命令的使用方 ...