38 lines
830 B
C++
38 lines
830 B
C++
/* STL */
|
||
#include <algorithm>
|
||
#include <deque>
|
||
#include <functional>
|
||
#include <iterator>
|
||
#include <list>
|
||
#include <map>
|
||
#include <memory>
|
||
#include <numeric>
|
||
#include <queue>
|
||
#include <set>
|
||
#include <stack>
|
||
#include <utility>
|
||
#include <vector>
|
||
/* STD */
|
||
#include <iostream>
|
||
#include <string>
|
||
#include <cstdlib>
|
||
#include <math.h>
|
||
using namespace std;
|
||
|
||
/* Объединение вектора и массива в список
|
||
*/
|
||
|
||
int main (int argc, char *argv[]) {
|
||
vector<int> a(5);
|
||
a[0] = 2; a[1] = 3; a[2] = 8;
|
||
a[3] = 20; a[4] = 25;
|
||
int b[6] = {7, 9, 23, 28, 30, 33};
|
||
list<int> c; // Список с начала пуст
|
||
merge(a.begin(), a.end(), b, b+6, inserter(c, c.begin()));
|
||
list<int>::iterator i;
|
||
for (i=c.begin(); i != c.end(); ++i)
|
||
cout << *i << " ";
|
||
cout << endl;
|
||
return 0;
|
||
}
|