天天看點

尋找子串(字典序)

#include<bits/stdc++.h>
using namespace std;
int main(){
 string s,mmax="a",temp;
    cin>>s;
    for(int i=0;i<s.length();i++)
    {
     temp="";
     for(int j=i;j<s.length();j++)
     {
      temp+=s[j];
  }
  if(temp>mmax)mmax=temp;
 }
 cout<<mmax;
 
}