#include #include #include using namespace std; void generatePermutations(vector* chset, int length, string cur = "") { if(cur.size() >= length) { cout<::iterator it = chset->begin(); it < chset->end(); it++) { cur.push_back(*it); generatePermutations(chset, length, cur); cur.pop_back(); } } int main() { ios::sync_with_stdio(false); int n; cout<<"Char set size: "; cin>>n; vector chset; for(int i=0; i>c; chset.push_back(c); } int k; cout<<"Generated word length: "; cin>>k; cout<<"Generated combinations:\n"; generatePermutations(&chset, k); cout.flush(); return 0; }