#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using std::cout;
using std::endl;
int main()
{
std::vector<int> vec = { 3, 1, 4, 2, 5, 8, 6, 9 };
std::vector<int>::iterator pos;
int n = 4;
pos = std::find_if(vec.begin(), vec.end(), std::bind2nd(std::greater<int>(), n));
cout << distance(vec.begin(), pos) + 1 << endl;
return 0;
}
/*
run:
5
*/