View Code of Problem 3832

#include<stdio.h>
#include<string.h>
#define Max 1000000
int main()
{
	char a[100000],b[100000];	
	while(scanf("%s",a)!=EOF)
	{
		scanf("%s",b);
		char *t=strstr(a,b);
		if(t)
		{
			int len=strlen(a);
			int len1=strlen(t);
			printf("%d\n",len-len1+1);
		}
		else
			printf("-1\n");

	}
		return 0;
}

Double click to view unformatted code.


Back to problem 3832