T1:重复的子字符串
class Solution {
public:
bool repeatedSubstringPattern(string s) {
int length = s.size();
if (length < 2) return false;
for (int i = 1; i <= length/2; i++) {
if (length % i != 0) continue;
string temp = s.substr(0, i);
string ans = "";
for (int j = 1; j <= length/i; j++) {
ans += temp;
}
if (ans == s) return true;
}
return false;
}
};