三次翻转(分治) #include <iostream> using namespace std; void reverse(char c[], int begin, int end){ for (int i = 0; i < (end - begin + 1) / 2; ++i) { char temp; temp = c[begin + i]; c[begin + i] = c[end - i]; c[end - i] = temp; } } void leftMove(char c[], int n, int k){ int m = k % n; reverse(c, 0