There is really no easy way to bypass that issue in Xcode, you could try to have a loop that introduces 250 or so blank endlines (endl) and it could look like the screen was cleared and you are refreshing it, but it could get messy.
The other alternative is to run your program from the OSx Terminal, for this you first navigate to where your .cpp code is, in my case it is in my desktop under the Test/Test so I navigate there using the cd (change directory) command, then I proceed to compile the C++ program using the make command as below. It creates an executable main without the .cpp extension
Next, I proceed to run the program
And below is the result as expected. You should only see one of the cout and that is why the screen was cleared and the first cout is gone.