#include <iostream>
using namespace std;
int main()
{
int n, v[100], i, temp, v2[100];
cout << "n= "; cin >> n;
cout << " introdu " << n << " numere intregi " << endl;
for (i=0; i<n; ++i)
{
cin >> v[i];
v2[i]=v[i];
}
temp=v[n-1];
for (i=n-1; i>0; --i)
v[i]=v[i-1];
v[0]=temp;
cout << "a) Deplasare spre dreapta: " << endl;
for (i=0; i<n; ++i)
cout << v[i] << " ";
cout << endl;
temp=v2[0];
for (i=0; i<n-1; ++i)
v2[i]=v2[i+1];
v2[n-1]=temp;
cout << "b) Deplasare spre stanga: " << endl;
for (i=0; i<n; ++i)
cout << v2[i] << " ";
cout << endl;
}