#include <stdio.h> #include <string.h> void mark(char str[],int s[]); char str1[100001],str2[100001]; int main() { int j; //读入 while(gets(str1)!=NULL) { gets(str2); j = strstr(str1, str2)-str1; if(j!=0) { printf("%d\n",j+1); } else { printf("-1\n"); } } } |
Double click to view unformatted code.