View Code of Problem 3832

#include<stdio.h>
#include<string.h>
int main()
{
	char str[100000],str1[100000];
	while (scanf("%s %s",&str,&str1)!=EOF)
	{
		if (strstr(str, str1) != NULL)
		{
			printf("%d\n", strstr(str, str1) - str + 1);
		}
		else {
			printf("%d\n", -1);
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3832