View Code of Problem 3832

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

Double click to view unformatted code.


Back to problem 3832