This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

23
TangDou/LianXiTi50/36.cpp Normal file
View File

@@ -0,0 +1,23 @@
#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;
}