At first I thought it was stuck on something but it was just waiting for input. How were you inputting to the program before?
I ran it again and only put in
1 2 3 4 5
and it waited, like a good little program. For me to finish
6 7 8 9 10
This is because inside of the loop in your count function it will loop through 10 "cin" commands. Since cin only reads up until a blank space the stream will read all 10 consecutive inputs. If you did:
1 2 3 4 5 6 7 8 9 10 11
It would still only print out 1 - 10.
On a side note: If you wanted to read the entire line and not just up until a blank character you'd use this command instead:
getline(cin, input);
That'll read until the end of the line in the stream and parse it into input.