Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- using namespace std;
- int main() {
- int n, l_, r_;
- cin >> n;
- srand(time(0));
- int *arr = new int[n];
- for(int i = 0; i < n; ++i)
- arr[i] = rand() % 10;
- cin >> l_ >> r_;
- for(int i = 0; i < n; ++i)
- cout << arr[i] << " ";
- cout << "\n\n";
- for(int i = 0; i < n - l_ - 2; ++i)
- arr[l_ + i] = arr[r_ + i + 1];
- for(int i = 0; i < n - (r_ - l_ + 1); ++i)
- cout << arr[i] << " ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement