gia nhu giai tich de hieu
NguyenAnhQuan
c_cpp
a year ago
478 B
5
Indexable
Never
#include <bits/stdc++.h> #define ll long long #define LIM 1000005 #define X first #define Y second #define EL cout<<"\n" using namespace std; int a[LIM]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, x, k; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; cin >> x >> k; for (int i = n; i >= k + 1; i--) a[i] = a[i - 1]; a[k] = x; for (int i = 0; i <= n; i++) cout << a[i] << " "; return 0; }