1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
int main() {
int list1[10] = {12, 34, 56, 21, 34, 78, 34, 56, 12, 25};
int list2[2] = {34, 56};
int list3[5] = {33, 48, 21, 34, 73};
int *location;
ostream_iterator<int> screen(cout, " ");
location = find_end(list1, list1 + 10, list2, list2 + 2);
copy(list1, list1 + 10, screen);
cout <<"\n" << *location <<"\n\n";
location = find_first_of(list1, list1 + 10, list3, list3 + 5);
copy(list1, list1 + 10, screen);
cout <<"\n" << *location <<"\n\n";
}
|