本文主要是介绍后缀子串排序【上海交通大学】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
牛客网题目链接
简单字符串排序
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdio>
#include <cctype>
#include <unordered_map>
#include <map>
using namespace std;
const int N = 1005;
typedef pair<int, string> PII;
int main(){string str;cin>>str;vector<string> vt;for(int i = 0; i < str.size(); i++){string t = str.substr(i);vt.push_back(t);}sort(vt.begin(), vt.end());for(auto v: vt){cout<<v<<endl;}return 0;
}
这篇关于后缀子串排序【上海交通大学】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!