// test.cpp: 定义控制台应用程序的入口点。//#include "stdafx.h"#include#include using namespace std;void reverse(char a[], int low, int high) { int i = low, j = high, temp; while (i < j) { temp = a[i]; a[i] = a[j]; a[j] = temp; i++; j--; }}void move(char a[], int n, int p) { reverse(a, 0, p - 1); reverse(a, p, n - 1); reverse(a, 0, n - 1);}int main(){ int length, p; char a[100]; cin >> length; cin >> p; cin >> a; move(a, length, p); cout << a; return 0;}