dimanche 19 janvier 2020

(C++) Making a random sequence of a set of numbers 1-3

I need my program to make a random sequence from 1-3 each time, but I don't understand how I'd use rand() to make the sequence of numbers 1 to 3 in a different order each program. It can't be the same number again, so I don't know what I'd do to prevent that. An example run would be

123 the first, 231 the second, 321 and so fourth

What would you use to make a sequence that doesn't repeat numbers




Aucun commentaire:

Enregistrer un commentaire