solution.cpp 284 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

#include <bits/stdc++.h>

using namespace std;

int main()
{
    set<string> s;
    string str;
    cin >> str;
    for (int i = 0; i < str.size(); i++)
        for (int j = i; j < str.size(); j++)
            s.insert(str.substr(i, j - i + 1));
    cout << s.size();
    return 0;
}