#include <stdio.h> #include <string.h> char str1[100050],str2[100050]; int main() { int i; int j; while(scanf("%s",str1)!=EOF) { scanf("%s",str2); j = strstr(str1, str2)-str1; if(j>=0) { printf("%d\n",j+1); } else { printf("-1\n"); } } } |
Double click to view unformatted code.