View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832