You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
444 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N];
int main() {
int n, m;
//用例5,3
cin >> n >> m;
//用例: 1 2 3 4 5
for (int i = 1; i <= n; i++)cin >> a[i];
for(int k=1;k<=m;k++){
//移动一位
a[0] = a[n];
for (int i = n; i >= 1; i--)a[i] = a[i - 1];
a[1] = a[0];
}
for(int i=1;i<=n;i++) cout<<a[i]<<" ";
return 0;
}