#include
#include
int main() {
char a[100], b[100];
int count = 0;
printf("请输入字符串a:");
scanf("%s", a);
printf("请输入字符串b:");
scanf("%s", b);
int len_a = strlen(a);
int len_b = strlen(b);
for (int i = 0; i <= len_b - len_a; i++) {
if (strncmp(a, b + i, len_a) == 0) {
count++;
}
}
printf("字符串a在字符串b中出现的次数为:%d\n", count);
return 0;
}