Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, k1, k2;
- cin >> n >> k1 >> k2;
- int* a = new int[n];
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- }
- for (int i = 0; i < n; i++) {
- if (i >= k1-1 && i <= k2-1) {
- for (int j = i; j < n; j++) {
- a[j] = a[j + 1];
- }
- n--;
- i--;
- k2--;
- }
- }
- for (int i = 0; i < n; i++) {
- cout << a[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement