Advertisement
tungggg

xauconkhacnhau

Feb 5th, 2022
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. using namespace std;
  2. #include<bits/stdc++.h>
  3.  
  4. int main() {
  5.     set<string> st;
  6.     string s;
  7.     cin>>s;
  8.     for(int i=0;i<s.size();i++){
  9.         for(int j=i;j<s.size();j++){
  10.             string current = s.substr(i,j-i+1);
  11.             st.insert(current);
  12.         }
  13.     }
  14.     cout<<st.size();
  15.    return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement