Advertisement
dmitryokh

Untitled

Dec 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <algorithm>
  2. #include <vector>
  3. #include <string>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. vector <string> v;
  10. string s0;
  11. while (getline(cin, s0)) {
  12. for (int i = 0; i < s0.size(); ++i) {
  13. if (s0[i] == '/') {
  14. if (i != s0.size() - 1) {
  15. string a = s0.substr(0, i);
  16. if (find(v.begin(), v.end(), a) == v.end())
  17. v.push_back(a);
  18. }
  19. }
  20. }
  21. }
  22. sort(v.begin(), v.end());
  23. for (int i = 0; i < v.size(); ++i) {
  24. cout << v[i] << "/" << endl;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement