Unable to debugg

#include
#include
using namespace std;
int main () {

int n;
cin>>n;
stack<int> s;
while(n--)
{
	int k;
	cin>>k;
	if(k==1)
	{ if(!s.empty())
	{
		cout<<s.top()<<endl;
		s.pop();
	}
    // else
    // cout<<endl;
	
		
	}
	else if(k==2)
	{
		int t;
		cin>>t;
		s.push(t);
	}
}
return 0;

}

If stack is empty, you have to display “No Code”. This is mentioned in the question. Read it carefully.

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.