Varianta 23 / Subiectul 3 / Problema 3 |
#include<iostream> using namespace std; int main() { int n,i,k,aux,a[20]; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(k=n;k>=2;k--) { aux=a[1]; for(i=1;i<k;i++) a[i]=a[i+1]; a[k]=aux; for(i=1;i<=n;i++) cout<<a[i]<<" "; cout<<endl; } system("pause"); return 0; } |