Works perfectly on my machine ,but run error on CB IDE

#include iostream
#include stack
using namespace std;

int main()

{

long int n;
cin>>n;
stack<long int> a;
for(long int i=0;i<n;i++)
{
	int c;
	cin>>c;
	if(c==1)
	{
	    cout<<a.top()<<"\n";
		a.pop();
	}
	else
	{
		long int q;
        cin>>q;
        a.push(q);
	}
}

return 0;
}

hello @sxmeer_ahmed
u are poping element from stack without checking whether stack is empty or not.
if stack is empty then in that case u cannot pop element from it, in that case u should print No code(check output format of this question).

image