Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int niza[n];
- for(int i = 0; i < n; i++) {
- cin >> niza[i];
- }
- int m;
- cin >> m;
- int niza2[m];
- for(int i = 0; i < m; i++) {
- cin >> niza2[i];
- }
- int niza3[n + m]; // volkava ke e spoenata niza
- int brojac = 0;
- for(int i = 0; i < n; i++) {
- niza3[brojac] = niza[i];
- brojac++;
- }
- for(int i = 0; i < m; i++) {
- niza3[brojac] = niza2[i];
- brojac++;
- }
- sort(niza3, niza3 + n + m);
- for(int i = 0; i < brojac; i++) {
- cout << niza3[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement