#include <iostream>
#include <set>
using namespace std;
typedef set<int> SETINT; // SETINT是别名,
int main()
{
SETINT a;
a.insert(67);
a.insert(7);
a.insert(-2);
SETINT::const_iterator i;
for (i = a.begin(); i != a.end(); ++i)
{
cout << *i << endl;
}
SETINT::iterator i_found = a.find(70);
if (i_found != a.end())
cout << "找到了," << *i_found << endl;
else
cout << "没有找到," << endl;
return 0;
}
set集中查找find
最新推荐文章于 2024-04-06 15:55:38 发布