题解 | #后缀子串排序#
后缀子串排序
https://www.nowcoder.com/practice/f89f96ea3145418b8e6c3eb75773f65a
#include<iostream> #include<string> #include<algorithm> using namespace std; string ss[1100]; int main(void) { string s; cin >> s; int index = 0; for(int i = 0;i < s.size();i++) { ss[index++] = s.substr(i, s.size() - i); } sort(ss,ss+index); for(int i = 0;i < index;i++) cout << ss[i] << endl; return 0; }