#include<iostream>
using namespace std;
int Permutare(int n )
{
int i , p = 1;
int x = n;
while ( x > 9 )
{
x = x/10;
p = p * 10;
}
n = n%p*10 + x;
return n;
}
int NrCifre(int n )
{
int nr = 0;
while ( n )
{
nr++;
n /=10;
}
return nr;
}
int main()
{
int n;
cin >> n;
for ( int i = 1; i <= NrCifre(n);i++)
{
n = Permutare(n);
cout << n;
cout << '\n';
}
system("Pause");
return 0;
}
|