首页 > 其他 > 详细

CCF_ 201409-3_字符串匹配

时间:2016-09-06 21:08:02      阅读:223      评论:0      收藏:0      [点我收藏+]

水。

 

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;

int main()
{
    char a[105],b[105];
    cin >> a;
    strcpy(b,a);
    strlwr(b);
    int flag,n;
    cin >> flag >> n;
    while(n--)
    {
        char temp[105],temp2[105];
        cin >> temp;
        strcpy(temp2,temp);
        if(!flag)
        {
            strlwr(temp2);
            if(strstr(temp2,b)) cout << temp << endl;
        }
        else
        {
            if(strstr(temp,a)) cout << temp << endl;
        }
    }
    return 0;
}

 

CCF_ 201409-3_字符串匹配

原文:http://www.cnblogs.com/zhurb/p/5846970.html

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