solution1 测试点3是n==1的情况 int转string:str = to_string(i) string转int:i = atoi(str.c_str()) #include<iostream> #include<string> using namespace std; int main(){ int n, cnt; char x; string ans, t; cin >> t >> n; for(int i = 2; i <= n; i++){ ans = t[0]; x = t[0]; cnt = 1; for(int i = 1<