#include #include #include #include using namespace std; int main() { ifstream inputFile("clown.in"); string ramble; int parts; inputFile >> ramble; inputFile >> parts; ofstream outputFile("clown.out"); do { parts--; string part; inputFile >> part; int count = 0; for (size_t offset = ramble.find(part); offset != string::npos; offset = ramble.find(part, offset + 1)) { count++; } outputFile << count << '\n'; } while (parts > 0); return 0; }