思路:要用到递归的思想。在获得某个子序列以后,然后从子序列后面的位置开始,将后面的字符依次添加到子序列的后面。
代码:
/*
substr:子序列
vec:存放子序列的vector
pos:字符串中当前子序列的后面一位
*/
#include <iostream>
#include <vector>>
#include <string>
using namespace std;
void Getsubstrextend( string& src, int pos, string substr, vector<string>& vec)
{
if( pos == src.size() )