char * cyp(char *s1,char *s2) { char *p = NULL; char *q = NULL; char *q1 = NULL; while(*s1!='\0') { if(*s1==*s2) { p = s1; q = s1; q1 = s2; while(*q1!='\0') { if(*q++!=*q1++) { p = NULL; break; } } } if(p!=NULL) break; s1++; } return p; }
char * cyp(char *s1,char *s2) { char *p = NULL; char *q = NULL; char *q1 = NULL; while(*s1!='\0') { if(*s1==*s2) { p = s1; q = s1; q1 = s2; while(*q1!='\0') { if(*q++!=*q1++) { p = NULL; break; } } } if(p!=NULL) break; s1++; } return p; }
转载于:https://www.cnblogs.com/wumac/p/7367801.html