링크 : https://www.acmicpc.net/problem/11656
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<string> v;
int main(){
string s = "";
cin >> s;
for(int i = 0; i < s.size(); i++){
string temp = "";
for(int j = i; j < s.size(); j++){
temp += s[j];
}
v.push_back(temp);
}
sort(v.begin(), v.end());
for(string s : v){
cout << s << '\n';
}
return 0;
}