POJ 1936

简介: /* 字符串匹配,(模式串 主串) 区分大小写 */ #include #include #include using namespace std; const int N = 100010; char str1[N],str2[N]; bool is_match...
/*
字符串匹配,(模式串   主串)
区分大小写
*/ 
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
const int N = 100010;
char str1[N],str2[N];
bool is_match()
{
    int i,j;
    if(strlen(str1)>strlen(str2))
        return false;    
    for(j=i=0;str1[i]!='\0'&&str2[j]!='\0';j++)
    if(str1[i]==str2[j])
        i++;
    if(str1[i]=='\0')
        return true;
    return false;
}   
int main()
{
    while(scanf("%s %s",str1,str2)!=EOF)
    {
        bool flag = is_match();
        if(flag)
            puts("Yes");
        else
            puts("No");
        memset(str1,0,sizeof(str1));
        memset(str2,0,sizeof(str2));
    }
    return 0;
}
        
     

  

目录
相关文章
|
容器
POJ 3640 Conformity
POJ 3640 Conformity
59 0
|
JavaScript
|
并行计算 网络架构
poj-1005-l tanink i need a houseboat
Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned ...
989 0
POJ 2262 Goldbach&#39;s Conjecture
Problem Description In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the foll...
1013 0
|
机器学习/深度学习 算法
|
机器学习/深度学习