跳到正文

个人记录

1

Aron_2023约 1 分钟
原文
文章信息与版本

文章信息

发布
2024年7月1日
收录
2026年7月2日
更新
2026年11月11日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
using namespace std;
string f[10001];
int cnt;
int main()
{
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		for(int j=i;j<s.size();j++)
		{
			f[++cnt] = s.substr(i,j-i+1);
		}
	}
	sort(f+1,f+cnt+1);
	cout<<f[1]<<endl;
	for(int i=2;i<=cnt;i++)
	{
		if(f[i]!=f[i-1])
		{
			cout<<f[i]<<endl;
		}
	}
}
原文