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