Don't know how to make a simple thing

I've just started programming in C++ and so I don't know how to do a simple thing: If I set 5 random numbers from 1 to 6, how can the program know that there are 3 or 4 same numbers? For example the numbers are: 1 - 4 - 5 - 4 - 4. How can the program understand that there are three 4?

Thanks in advance! (Sorry for my bad English, I'm Italian)
You need to store the random numbers in a collection, possibly an array.

If you sort the numbers, the matching ones will appear together.
Oh thanks!
Topic archived. No new replies allowed.