#include <iostream>
using namespace std;
//任务:将数组R中序列左移p个位置
#define Initsize 50
typedef struct {
int* data;
int length, maxsize;
}SqList;
//初始化
void Init(SqList& L)
{
int i;
L.data = new int[Initsize];
for (i = 0; i < 6; i++)
{
cin >> L.data[i];
}
L.length = i;
}
//先将0到p-1逆置,将p到n-1逆置,再将整个逆置
bool Reverse(SqList& L, int low, int high)
{
int temp;
if (L.length == 0 || low > high)
return false;
while (low<high)
{
temp = L.data[low];
L.data[low] = L.data[high];
L.data[high] = temp;
low++; high--;
}
return true;
}
int main()
{
SqList L;
Init(L);
cout << L.length;
int p = 2;
Reverse(L, 0, p-1);
Reverse(L, p, L.length-1);
Reverse(L, 0, L.length-1);
for (int i = 0; i < L.length; i++)
cout << L.data[i] << " ";
return 0;
}