源码如下,很简单的题目 int solve(char* s ) { int sizelen = strlen(s); int count = 0; while(*s != 0) { if(*s == 'c') count++; s++; } if (count == 1) return 1; if (sizelen >= count *2) return count*2-1; else return sizelen;