容器中不仅可以安放基本的数据类型,也可以放置指定的数据类型。
这里就简单介绍下set与结构体的混合使用,以及在set中搜索指定数据(这里需要用set的内置find函数,以及涉及到运算符的重载)
#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
struct Lov
{
int a,b;
bool operator<(const Lov&l)const//重
容器中不仅可以安放基本的数据类型,也可以放置指定的数据类型。
这里就简单介绍下set与结构体的混合使用,以及在set中搜索指定数据(这里需要用set的内置find函数,以及涉及到运算符的重载)
#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
struct Lov
{
int a,b;
bool operator<(const Lov&l)const//重