AC

耦园采雪  •  1年前


include <stdio.h>

include <string.h>

int main() {

char a[1005], b[1005];
gets(a);
gets(b);
int c = strlen(a);
int d = strlen(b);
int x = 0, y, z = 0;
for (int i = 0; i < d; i++) {
	y = i;
	for (int j = 0; j < c; j++) {

		if (a[j] == b[y]) {
			x++;
		}
		y++;
	}
	if (x == c) {
		z++;
	}
	x = 0;
}
printf("%d", z);
return 0;

}


评论:

请先登录,才能进行评论