View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832