Write a program below |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int N,K;
vector<int> myvector;
cin >> N>>K;
for (int i = 0; i < N; i++)
{
int b;
cin >> b;
myvector.push_back(b);
}
if(K>0)
rotate(
|
|
else
rotate(
|
|
for (auto now : myvector) {
cout << now << " ";
}}
|