点击查看代码 #include<iostream> using namespace std; string str; int main() { while (cin >> str, str != ".") { int len = str.size(); for (int n = len; n; n--) if (len % n ==0) { int m = len / n; string s = str.substr(0, m); string r; for (…
点击查看代码 #include<iostream> #include<algorithm> using namespace std; string a, b; int main() { cin >> a >> b; if (a.size() < b.size()) swap(a, b); for (int i = 0; i < a.size(); i ++) { a = a.substr(1) + a[0]; for (int j = 0; j…
点击查看代码 #include<iostream> using namespace std; string str; int n; int main() { cin >> n; while (n --) { cin >> str; int cnt = 0; char c; for (int i = 0; i < str.size(); i++) { int j = i; while (j < str.size() && str[i] == s…