Skip to content

Instantly share code, notes, and snippets.

@4u9u5tsong
Last active August 29, 2015 14:11
Show Gist options
  • Save 4u9u5tsong/cac025ec5f388b304cc0 to your computer and use it in GitHub Desktop.
Save 4u9u5tsong/cac025ec5f388b304cc0 to your computer and use it in GitHub Desktop.
c++, read numbers, many lines, and different # in each line, remove redundant
ifstream pbinfile(argv[2]);
vector<unordered_set<int> > numbers;
while(getline(pbinfile, stemp)){
istringstream buffer(stemp);
vector<int> line((istream_iterator<int>(buffer)),
istream_iterator<int>());
unordered_set<int> s(line.begin(), line.end());
numbers.push_back(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment