hdu 2087 剪花布条

来源:互联网 发布:php 访问私有属性 编辑:程序博客网 时间:2024/05/18 18:00
#include<iostream>#include<cstring>using namespace std;int main(void){char a[1001];char b[1001];int len,c;char*p;while(cin>>a&&a[0]!='#'){cin>>b;len=strlen(b);for(c=0,p=a;p=strstr(p,b);c++,p+=len);cout<<c<<endl;}return 0;}