fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5. using namespace std;
  6.  
  7. int main() {
  8. typedef std::vector<std::string> Strings;
  9. Strings strings = { "world", "good bye", "hello", "aloha" };
  10. sort(strings.begin(), strings.end());
  11. for (Strings::iterator it = strings.begin(); it != strings.end(); ++it) cout << *it << "\n";
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
aloha
good bye
hello
world