Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<vector>
- using namespace std;
- template<class T>
- void costamol( vector<T>& result , const vector<T>& source, const T& key)
- {
- for(typename vector<T>::const_iterator i=source.begin(); i!=source.end(); i++)
- {
- if((*i)<key)
- result.push_back(*i);
- }
- }
- int main()
- {
- vector<int> a;
- vector<int> b;
- a.push_back(1);
- a.push_back(6);
- a.push_back(8);
- costamol<int>(b,a,4);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement