1 //比较两个字符串大小 2 bool compareSub(char* const s1,char* const s2) 3 { 4 int i=0; 5 while((i<strlen(s1))&&(i<strlen(s2))) 6 { 7 if(toupper(s1[i])<toupper(s2[i])) 8 return true; 9 else if(toupper(s1[i])>toupper(s2[i])) 10 return false; 11 ++i; 12 } 13 return strlen(s1)>strlen(s2); 14 } 15 16 //比照两个字符串的公共子串 17 int commonSub(char* s1,char* s2,char* comChar) 18 { 19 int i=0; 20 while((i<strlen(s1))&&(i<strlen(s2))) 21 { 22 if(toupper(s1[i])==toupper(s2[i])) 23 { 24 comChar[i]=s1[i]; 25 ++i; 26 } 27 else 28 break; 29 } 30 comChar[i]='