写个代码吧,我不会了

img

char str1[20],str2[10];
char *p=strstr(str1,str2);
if(!p)
printf("主串不包含子串")
else
printf("%d",p-str1+1);