C++ cartesian product of multiple strings
问题 I have strings stored in a vector as such: vector<string> ex = {"ab", "cd", "ef"} . Now I need to create the cartesian product of these strings (number of strings in the vector, nor the length of the strings is fixed!). The result should be: ace acf ade adf bce bcf bde bdf Is there a build-in function that exists already for this, or do you have any advice how to perform the implementation? The single letters of the strings should be used for the cartesian product not the entire string! 回答1: