#include <iostream>
using namespace std;
void rotatebackward(int array[],int size);
int main()
{
int value[6]={250,100,150,350,500,400};
rotatebackward(value,6);
cout<<"position "<<"value"<<endl;
for(int i=6;i<12;i++)
{cout<<i-5<<" "<<value[i]<<endl;
}
return 0;
}
void rotatebackward(int array[],int size)
{
for(int i=2;i<6;i++)
{
array[i+6]=array[i-2];
}
array[6]=array[4];
array[7]=array[5];
}
0 comments:
Post a Comment