#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char a[100000],b[100000]; int i; while(gets(a)!=NULL) { gets(b); i=strstr(a,b)-a; if(i>=0) { printf("%d\n",i+1); } else { printf("-1\n"); } } return 0; } |
Double click to view unformatted code.