You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include<bits/stdc++.h>
|
|
|
|
|
using namespace std;
|
|
|
|
|
int main() {
|
|
|
|
|
set<int> s;
|
|
|
|
|
s.insert(1);
|
|
|
|
|
s.insert(2);
|
|
|
|
|
s.insert(3);
|
|
|
|
|
s.insert(1);
|
|
|
|
|
cout<<"set <20><> size ֵΪ <20><>"<<s.size()<<endl;
|
|
|
|
|
cout<<"set <20><> maxsize<7A><65>ֵΪ <20><>"<<s.max_size()<<endl;
|
|
|
|
|
cout<<"set <20>еĵ<D0B5>һ<EFBFBD><D2BB>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> <20><>"<<*s.begin()<<endl;
|
|
|
|
|
cout<<"set <20>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>:"<<*s.end()<<endl;
|
|
|
|
|
s.clear();
|
|
|
|
|
if(s.empty()) {
|
|
|
|
|
cout<<"set Ϊ<><CEAA> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
|
|
|
|
}
|
|
|
|
|
cout<<"set <20><> size ֵΪ <20><>"<<s.size()<<endl;
|
|
|
|
|
cout<<"set <20><> maxsize<7A><65>ֵΪ <20><>"<<s.max_size()<<endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|