把由字符‘C’和‘D’混合的字符串分红前半部分全是‘C’或‘D’所须要的最少步骤

#include <iostream> #include <vector> #include <algorithm> using namespace std; int calcSwapCount(char bc, char ec, char *str, int n) { int count = 0; int begin = 0, end = n - 1; while (be
相关文章
相关标签/搜索