View Code of Problem 3832

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main() {
	char x[1000000], x2[1000000];
	while (scanf("%s %s", x, x2) != EOF) {
		if (strstr(x, x2) != NULL) {
			printf("%d\n", strstr(x, x2) - x + 1);
		}
		else {
			printf("%d\n", -1);
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3832