Run ID:120304
提交时间:2025-05-25 11:26:28
#include <bits/stdc++.h> using namespace std; int main() { int a[108]; int n ,pos, tmp; cin >> n; for(int i = 1;i<= n;i++) { cin >> a[i]; } int m; cin >> m; for(int j = 1;j <=m;j++) { cin >> pos; tmp = a[pos]; for(int t = pos + 1;t <= n ;t++) { a[t -1] = a[t]; } a[n] = tmp; } for(int i = 1;i <= n;i++) { cout << a[i] <<" "; } return 0; }