好耶

你这代码保熟吗?(鸡叫)  •  1年前


include <stdio.h>

include <string.h>

int main() {

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

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

}


评论:

请先登录,才能进行评论