摘要: int compress(char* chars, int charsSize){ int pst = 0; int anchor = 0; for (int i=0; i<charsSize; i++) { if (i == charsSize-1 || chars[i] != chars[i+1 阅读全文
posted @ 2020-09-04 18:54 温暖了寂寞 阅读(151) 评论(0) 推荐(0) 编辑
摘要: char ** stringMatching(char ** words, int wordsSize, int* returnSize){ char** arr = (char**)calloc(wordsSize,sizeof(char*)); int n =0; for (int i=0; i 阅读全文
posted @ 2020-09-04 15:04 温暖了寂寞 阅读(183) 评论(0) 推荐(0) 编辑
摘要: //如果s2 是s1的子串, 那么s2 必然在s1+s1里面 bool isFlipedString(char* s1, char* s2){ if (strlen(s1) != strlen(s2))return false; char* arr = (char*)calloc(sizeof(ch 阅读全文
posted @ 2020-09-04 13:16 温暖了寂寞 阅读(181) 评论(0) 推荐(0) 编辑
摘要: char* replaceSpaces(char* S, int length){ char* s = (char*)calloc(length*3+1,sizeof(char)); int n = 0; for (int i=0; i<length; i++) { if (S[i] == ' ') 阅读全文
posted @ 2020-09-04 11:33 温暖了寂寞 阅读(114) 评论(0) 推荐(0) 编辑
摘要: bool checkRecord(char * s){ int Acount = 0; int Lcount = 0; for (int i=0; i<strlen(s); i++) { if (s[i] == 'A') { Acount++; if (Acount > 1) return fals 阅读全文
posted @ 2020-09-04 11:15 温暖了寂寞 阅读(154) 评论(0) 推荐(0) 编辑