How to edit this C++ code of generating all passwords from given character set, so that the output should be only with the limited number of characters, For example
Input