Run ID:1652

提交时间:2023-10-29 08:03:23

# include<iostream> using namespace std; int main() { int n,m,l,s; cin>>n; int lst[n]; for(int i = 0; i < n; i++) { cin>>lst[i]; } cin>>m; l = lst[n-1]; for(int i = n-1; i >= m; i--) { lst[i] = lst[i-1]; } lst[m-1] = l; for(int i = 0; i < n; i++) { cout<<lst[i]<<" "; } }