思路:直接按题意模拟,维护一个指针表示当前指向的字母位置,每次按照步长增加即可。由于题目给的字符串是一个循环字符串,因此指针需要不断对字符串的长度取模。 #include <bits/stdc++.h> using namespace std; int main() { string s; int k; cin >> s >> k; string res; int step = 1; int i = 0, j = 0; int n = s.length(); while (j &...