关于集合set的去重复,向集合中插入元素
#include<iostream>
#include<set>using namespace std;int main(){ set<int>myset; int num; for(int i=0;i<6;i++) { cin>>num;myset.insert(num); } //for(int i=0;i<myset.size();i++) set<int>::iterator te=myset.begin(); while(te!=myset.end()) { cout<<*te<<" "; te++; } return 0;}