Program not working in the test site

My program works when I compile it in xcode but when I compile it here it does not.

Hey @lopezeselmejor
Removed this from ur code

cout << "Give me the number of numbers you want\n ";

NEVER ADD UNWANTED OUTPUT IN YOUR CODE OTHERWISE IT WILL NEVER PASS

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

I think I dont understand how challenges work. Like my code works, but I do not know what to do with it.

I have new code, so your replies Kartik are from my old code, if you are checking again, could you please tell me what I did wrong this time.

Ques How challenge works
ans
it takes your code and run it
now judge takes the output of your code and actual output
compares both if same testcase passed otherwise failed

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.