[ create a new paste ] login | about

Link: http://codepad.org/N0BMXqpI    [ raw code | output | fork ]

C++, pasted on Jul 22:
#include <iostream>
#include <functional>
#include <vector>
#include <algorithm>

using namespace std;

int main(void)
{
        int iv[10] = {1,2,3,4,5,6,7,5,4,12};
        vector<int>vec(iv,iv+5);
        vector<int>nvec;
        vector<int>::iterator iter=vec.begin();
        const int val=5;
        
        while((iter=find_if(iter, vec.end(), bind2nd(less<int>(), val))) != vec.end());
        {
                nvec.push_back(*iter);
                iter++;
        }

        for(unsigned int i=0; i<nvec.size() ; ++i)
        {
                cout<<nvec[i];
        }
return 0;
}


Output:
1
Timeout


Create a new paste based on this one


Comments: