记录下,不是太明白
#include<iostream>
#include<string>
using namespace std;
string str;
void dfs(int& i) {
if (str[i] <'a'||str[i]>'z') { return; }
else {
//cout << str[i] << " ";
int t = i;
++i;
dfs(i);
cout << str[t] << " ";
++i;
dfs(i);
}
}
int main()
{
cin>>str;
int i = 0;
dfs(i);
return 0;
}