Skip to content

Instantly share code, notes, and snippets.

@victorsenam
Created June 7, 2018 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorsenam/10bcc0358c5ae118bdb00b31cbb4dc2a to your computer and use it in GitHub Desktop.
Save victorsenam/10bcc0358c5ae118bdb00b31cbb4dc2a to your computer and use it in GitHub Desktop.
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
int main() {
int n;
std::cin >> n;
std::vector<std::string> v;
for (int i = 0; i < n; i++) {
std::string str;
cin >> str;
v.push_back(str);
}
std::sort(v.begin(), v.end());
for (int i = 0; i < n; i++) {
std::cout << v[i] << std::endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment