1、关于stl #include <iostream> #include <vector> #include <iterator> #include <algorithm> #include <functional> using namespace std; class GT_cls { public: GT_cls(int val) : value(val) {} bool operator() (int other) { return (other > value); } private: int value; }; int main() { istream_iterator<int> in(cin), eof; vector<int> vec; copy(in, eof, back_inserter(vec)); vector<int>::iterator iter = find_if(vec.begin(), vec.end(), GT_cls(5)); //找第一个大于5的元素 if(iter != vec.end()) cout<<"The first > 5 is : "<<*iter<<endl; copy(vec.begin(), vec.end(), ostream_iterator<int>(cout, " ")); cout<<endl; //查找所有大于5的元素 vector<int>::iterator iter1 = find_if(vec.begin(), vec.end(), bind2nd(greater<int>(), 5)); while(iter1 != vec.end()) { cout<<*iter<<" "; iter1 = find_if(++iter, vec.end(), bind2nd(greater<int>(), 5)); } cout<<endl; } 2、WINAPI http://baike.baidu.com/view/2311822.htm?tp=0_11