#include "iostream"
#include "vector"
#include "algorithm"
using namespace std;
struct C
{
int a;
vector<int> v;
bool operator < (
const struct C &c)
const
{
return v < c.v;
}
};
int main()
{
C c;
for(
int i=
0; i<
3; i++)
c.v.push_back(i);
c.a =
10;
C d;
d = c;
for(
int j=
0; j<
3; j++)
cout << d.v[j] <<
" ";
cout << endl << d.a << endl << endl;
C e;
e.v.push_back(
2);
e.a =
11;
e = c;
for(j=
0; j<
3; j++)
cout << d.v[j] <<
" ";
cout << endl << d.a << endl;
return 0;
}
转载请注明原文地址: https://ju.6miu.com/read-11684.html