STL
set
#include<bits/stdc++.h>
using namespace std;
int main() {
set<int>s;
s.insert(1);
s.insert(3);
s.insert(5);
for(auto p=s.begin();p!=s.end();p++)
printf("%d ",(*p));
puts("");
//1 3 5
for(auto p=s.rbegin();p!=s.rend();p++)
printf("%d ",(*p));
puts("");
//5 3 1
printf("%d",(int)s.size());
//3
//注意size返回無符號型別,做減法記得強轉int
}