Why my code is not working

No ouput is coming for input- 5 1 2 3 4 5
#include<bits/stdc++.h>
using namespace std;

class stack1{
vector v;
public:
void push(int data)
{
v.push_back(data);
}
bool empty()
{
return v.size();
}
void pop()
{
if(!empty())
v.pop_back();
}
int top()
{
return v[v.size()-1];
}
};

int main()
{
stack1 s;

int n;
cin>>n;
for(int i=0;i<n;i++)
{
    int x;
    cin>>x;
    s.push(x);
}

while(!s.empty())
{
    cout<<s.top()<<" ";
    s.pop();
}
return 0;

}

Please save your code on ide.codingblocks.com and then share its link.

@Akshay123 check now. changed line 13

appreciate your effort