#include<iostream>
using namespace std;
void Permutare( int a[10] , int n )
{
int aux = a[1];
for ( int i = 1 ; i <= n -1; i++ )
a[i] = a[i+1];
a[n] = aux;
}
void Afisare( int x[10] ,int n)
{
int i;
for ( i = 1 ; i <= n ;i++)
cout << x[i] << ' ';
cout << '\n';
}
int main()
{
int i , x[10] , n;
cin >> n;
for ( i = 1 ; i <= n ; i++ )
cin >> x[i];
for ( i = 1 ; i <= n; i++ )
{
Permutare ( x , n );
Afisare ( x , n );
}
system("pause");
return 0;
}
|