Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

23 lines
444 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}