1 #include<stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <ctype.h> 5 #include <math.h> 6 7 char *Mystrstr(const char *string, const char *strCharSet) 8 { 9 if (NULL == string) 10 { 11 return (char *)string; 12 } 13 if (NULL == strCharSet) 14 { 15 return NULL; 16 } 17 int nLen1 = strlen(string); 18 int nLen2 = strlen(strCharSet); 19 20 for (int i = 0; i < nLen2; i++) 21 { 22 for (int j = 0; j <nLen1; j++) 23 { 24 if (strCharSet[i] == string[j]) 25 { 26 int nPos = j; 27 while ( (i < nLen2) &&(strCharSet[i] == string[j])) 28 { 29 i++; 30 j++; 31 } 32 if (i == nLen2) 33 { 34 return (char *)&string[nPos]; 35 } 36 i = nPos; 37 } 38 } 39 } 40 return NULL; 41 } 42 43 char *Mystrcpy( char *strDestination, const char *strSource ) 44 { 45 if (strDestination == NULL && strDestination == NULL) 46 { 47 exit(0); 48 } 49 50 while (*strSource != '