I have a program that inserts some integers into a set, and removes when I find an equal, after doing so, I need to bring in the output all integers that are still inside the set, however I am not able to do set and bring the information I want. Here is the code:
#include <stdlib.h>
#include <iostream>
#include <set>
using namespace std;
int main (){
int n,k,x;
set <int> di;
set <int>:: iterator it;
cin>>n;
for(int i=0; i<n; i++){
cin>>k;
for (int j=0; j<k; j++){
if (i!=0){
cin>>x;
it = di.find(x);
if (it!=di.end())
di.erase(it);
}
else{
cin>>x;
di.insert(x);
}
}
}
it = di.begin();
while(it!=di.end()){
cout<<⁢
di.erase(it);
it++;
}
}