dimanche 23 septembre 2018

How to generate all possible pairs from two vectors in C++?

I have two vectors:

vector<double>vec1={1, 2, 3, 4, 5}
vector<double>vec2={6, 7, 8, 9, 10}

and I want to generate all possible pairs like:

{1,6}, {1,7}, {1,8}, {1,9}, {1, 10}, {2,6}, {2, 7}...

Aucun commentaire:

Enregistrer un commentaire