View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832