View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832