您的位置:首页 > 其它

题目1094:String Matching

2017-04-16 22:56 148 查看


#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <stack>
#include <string>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <map>
#include <functional>
#include <set>
#include <limits.h>
#include <math.h>
#include <ctype.h>
using namespace std;
//1094
string t,p;
int main()
{  
    while(cin>>t>>p)
    {
        int a=t.find(p,0);
        int ant=0;
        while(a!=string::npos)
        {
            ant++;
            a=t.find(p,a+1);
        }
        cout<<ant<<endl;
    }
 
    return 0;
}
/**************************************************************
    Problem: 1094
    User: cust123
    Language: C++
    Result: Accepted
    Time:150 ms
    Memory:3052 kb
****************************************************************/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: