Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <array>
  3. #include <algorithm>
  4. #include <string>
  5.  
  6. using ui = unsigned int;
  7.  
  8. int
  9. main()
  10. {
  11. std::array<std::string, 200000> vec;
  12.  
  13. ui n{};
  14.  
  15. std::cin >> n;
  16.  
  17. for (uint8_t i{}; i < n; ++i) {
  18. std::cin >> vec.at(int(i));
  19. }
  20.  
  21. std::sort(vec.begin(), vec.end(),
  22. [](const auto &a, const auto &b) -> bool
  23. {
  24. return a < b;
  25. });
  26.  
  27. for (uint32_t i{}; i < n; ++i) {
  28. std::cout << vec.at(int(i)) << '\n';
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement