SEO – The easiest way to create a code that selects a random element from a stack

I'm just getting away with C ++. What is the easiest and shortest / easiest way to write a code that randomly selects an item from a stack and removes it from the stack, and prints the removed items N times?