#include <stdio.h>
void reverseArr(int arr[], int start, int end)
{
int temp = 0;
while (start < end) {
temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
end--;
}
}
int main()
{
int arr[] = {1, 2, 3, 4, 5, 6, 7};
int rotate = 2;
int size = 7;
int i = 0;
reverseArr(arr, 0, rotate - 1);
reverseArr(arr, rotate, size - 1);
reverseArr(arr, 0, size - 1);
for (i = 0; i < size; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHJldmVyc2VBcnIoaW50IGFycltdLCBpbnQgc3RhcnQsIGludCBlbmQpCnsKICAgIGludCB0ZW1wID0gMDsKCiAgICB3aGlsZSAoc3RhcnQgPCBlbmQpIHsKICAgICAgICB0ZW1wID0gYXJyW3N0YXJ0XTsKICAgICAgICBhcnJbc3RhcnRdID0gYXJyW2VuZF07CiAgICAgICAgYXJyW2VuZF0gPSB0ZW1wOwoKICAgICAgICBzdGFydCsrOwogICAgICAgIGVuZC0tOwogICAgfQoKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgYXJyW10gPSB7MSwgMiwgMywgNCwgNSwgNiwgN307CiAgICBpbnQgcm90YXRlID0gMjsKICAgIGludCBzaXplID0gNzsKICAgIGludCBpID0gMDsKCiAgICByZXZlcnNlQXJyKGFyciwgMCwgcm90YXRlIC0gMSk7CiAgICByZXZlcnNlQXJyKGFyciwgcm90YXRlLCBzaXplIC0gMSk7CiAgICByZXZlcnNlQXJyKGFyciwgMCwgc2l6ZSAtIDEpOwoKICAgIGZvciAoaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKICAgICAgICBwcmludGYoIiVkICIsIGFycltpXSk7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0K