Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <vector>
- using namespace std;
- vector<string> split(const string& to_split)
- {
- vector<string> splitted(1);
- for(auto i = to_split.begin(); i != to_split.end(); i++)
- {
- splitted.back() += *i;
- if(*i == '/')
- splitted.push_back(splitted.back());
- }
- return splitted;
- }
- int main() {
- set<string> nonempty;
- string line;
- while(cin >> line)
- {
- vector<string> cur_nonempty = split(line);
- cur_nonempty.pop_back();
- for(auto i = cur_nonempty.begin(); i != cur_nonempty.end(); i++)
- nonempty.insert(*i);
- }
- while(!nonempty.empty())
- {
- cout << *nonempty.begin() << endl;
- nonempty.erase(nonempty.begin());
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement