View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832