samedi 22 avril 2017

C++ Returning a random value from a subset of a Vector

Can someone help me figure out a way to return a value from a vector that has N values in sequential order. And the return value has to be in the upper half of the set.

For example,

If have a vector containing the following integers: {1, 2, 3. 4, 5, 6}

Return a random integer from {4,5,6}. I'm so stumped!




Aucun commentaire:

Enregistrer un commentaire