The first problem I found if line 8. "n" has to be a constant value either 10 or a variable defined as a constant. This type of array needs a constant value at compile time so the compiler will know how much memory to set aside for the array.
If you need to input a value for "n" and use it then you will have to create a dynamic array.
For what you have you are stuck with something like this:
1 2 3 4 5 6 7 8
int main()
{
constexprint MAXSIZE{ 10 };
int n;
cin >> n;
int arr[MAXSIZE], nge[MAXSIZE];
stack<int> s;
Now that it compiles I will test it shortly and see if I find anything else.