#include <iostream> #include <cstring> using namespace std; int main() { char str[100] = { 0 }; char substr[100] = { 0 }; cin.getline(str, sizeof(str)); cin.getline(substr, sizeof(substr)); int count = 0; // write your code here...... for (int i = 0; i < strlen(str); i++) { for (int j = 0; j < strlen(substr); j++) { if (substr[j] == str[i + j]) { if (j == strlen(substr) - 1) count++; } else break; } } cout << count << endl; return 0; }