主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
fzh
2024年3月18日 15:27
后缀子串排序 题解:substr+sort
P1294
回复 0
|
赞 0
|
浏览 159
#include<bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { vector<string> substr; for (int i = 0; i < s...
huanghu
2024年3月16日 16:57
后缀子串排序 题解:C++ sort
P1294
回复 0
|
赞 0
|
浏览 219
#include<stdio.h> #include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string str; string arr[100]; while(cin>>str){ int len = str.length(); for(int i = 0; i<len; i++){ string s = ""; for(int j = i; ...
sinkorswim
2024年3月14日 20:24
后缀子串排序 C++ map
P1294
回复 0
|
赞 2
|
浏览 160
#include<bits/stdc++.h> using namespace std; int main(){ string s; int i,len; while(cin>>s){ map<string,int> m; len=s.size();...
promising
2024年3月8日 15:43
后缀子串排序 题解:
P1294
回复 0
|
赞 1
|
浏览 235
#include<stdio.h> #include<string.h> int main() { char a[100]; char b[100][100]; int i,j; char t[100]; while(scanf("%s",&a)!=EOF){ &nbs...
williams
2024年3月8日 15:41
后缀子串排序 题解: c
P1294
回复 0
|
赞 0
|
浏览 235
#include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> #include <ctype.h> int main( ){ char s[100]; int j; while(fgets(s, sizeof(s), stdin)){ int len = strlen(s); if (s[len - 1] == '\n') s[len - 1] = '\...
Yw1111111
2024年3月8日 15:32
后缀子串排序 题解:Python
P1294
回复 0
|
赞 0
|
浏览 137
1294 AC while True: try: string = input() sub_string = [] for i in range(len(string)): sub_string.append(string[i:]) sorte...
我不是深井冰丶
2023年1月17日 18:07
使用string类
P1294
回复 1
|
赞 3
|
浏览 3.7k
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int len = s.length(); string arr[len]; for(int i = 0;i < len;i++){ arr[i] = s.substr(i,len-i); } sort(arr,arr+len); for(int i = 0;i < len;i++){ cout<<arr[...
小王桐学
2024年2月22日 21:59
后缀子串排序 题解:C题解
P1294
回复 0
|
赞 0
|
浏览 279
#include <stdio.h> #include <string.h> void Sort(char a[][100],int n) { int i,j; char t[100]; for(i = 0; i < n-1; i++) for(j = 1; j < n-i; j++) if(strcmp(a[j],a[j-1]) < 0) { strcpy(t,a[j]); strcpy(a[j],a[j-1]); strcpy(a[j-1],t); } }...
dongqing
2023年7月31日 16:22
后缀子串排序 题解:
P1294
回复 0
|
赞 1
|
浏览 461
1.分解字串采用s.substr(i,len-i) 2.可以直接sort就是字典排序 #include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s) { int len=s.size(); string p[len]; for(int i=0;i<len;i++) { p[i]=s.subst...
Hegel
2023年3月27日 19:18
输入字符串s,按照字典顺序输出它的所有子字符串
P1294
回复 0
|
赞 0
|
浏览 1.7k
#include <iostream> #include <string> using namespace std; //s1在字典里的顺序早于s2时输出小于0 int Comp(string s1, string s2) { int i, j; for (i = 0, j = 0; i < s1.size() && j < s2.size(); i++, j++) if (s1[i] != s2[j]) return s1[i] - s2[j]; return s1.size() - s2.siz...
1
2
题目
后缀子串排序
题解数量
15
发布题解
热门题解
1
使用string类
2
string类在后缀字符串的应用
3
后缀子串排序 C++ map
4
简洁
5
后缀子串排序 题解:
6
说输出格式错误?不太理解,不能AC,求大佬解答!!!
7
后缀子串排序 题解:
8
后缀子串排序 题解:C++ sort
9
后缀子串排序 题解:Python
10
后缀子串排序 题解: c