标签:hdu
abcde a3 aaaaaa aa #
0 3
#include <iostream> #include <cstring> using namespace std; char a[1010]; char b[1010]; int main() { while (cin >> a&& a[0]!='#') { cin >> b; int flag = 0; int num=0; int p1 = strlen(a); int p2 = strlen(b); for (int i=0; i<p1; i = i+p2) { flag = 0; for (int j=0; j<p2; j++) { if (b[j] != a[j+i]) flag = 1; } if (flag == 0) num++; } cout << num<< endl; } return 0; }
标签:hdu
原文地址:http://blog.csdn.net/xiaotan1314/article/details/46456795