#include <iostream.h>
#include <iomanip.h>
#include <math.h>
int main()
{
int a[10], k,n,i,j;
cout<<"Vvedite k:"<<endl;
cin>>k;
cout<<"Vvedite elementy:"<<endl;
for(i=0;i<k; i++)
cin>>a[i];
cout<<"Vvedite n:"<<endl;
cin>>n;
for(i=n-1;i>0;i--)
j=a[i];
a[i]=a[i-1];
a[i-1]=j;
}
for(i=0;i<k;i++)
cout<<"Result"<<a[i]<<endl;
return 0;
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream.h>
#include <iomanip.h>
#include <math.h>
int main()
{
int a[10], k,n,i,j;
cout<<"Vvedite k:"<<endl;
cin>>k;
cout<<"Vvedite elementy:"<<endl;
for(i=0;i<k; i++)
cin>>a[i];
cout<<"Vvedite n:"<<endl;
cin>>n;
for(i=n-1;i>0;i--)
{
j=a[i];
a[i]=a[i-1];
a[i-1]=j;
}
for(i=0;i<k;i++)
cout<<"Result"<<a[i]<<endl;
return 0;
}