1 #include <stdio.h> 2 #define MAXS 30 3 4 char *search(char *s, char *t); 5 void ReadString( char s[] ); /* 裁判提供,细节不表 */ 6 7 int main() 8 { 9 char s[MAXS], t[MAXS], *pos; 10 11 ReadString(s); 12 ReadString(t); 13 pos = search(s, t); 14 if ( pos != NULL ) 15 printf("%d ", pos - s); 16 else 17 printf("-1 "); 18 19 return 0; 20 } 21 22 /* 你的代码将被嵌在这里 */ 23 char *search(char *s, char *t) 24 { 25 26 int len = 0, i; 27 char *p, *ret; 28 29 p = t; 30 while (*p != '