Prateek sir and coding

https://ide.codingblocks.com/s/364615 prateek sir and coding is not passing test cases

hello @shrutikatyal

image

u havent handled this in ur code

https://ide.codingblocks.com/s/364619 still its not passing test case

check now->

#include<iostream>
#include<stack>
using namespace std;
int main()
{
	int Q;
	cin>>Q;
	stack<int>s;
	for(int i=0;i<Q;i++)
	{
		int a;
		cin>>a;
		switch(a)
		{
			case 1:
			    if(!s.empty())
				{
					cout<<s.top()<<endl;
				    s.pop();
				}
				else
				{
					cout<<"No Code\n"; // added \n
				}
				break;
			case 2:
			    int cost;
				cin>>cost;
				s.push(cost);
				break;
		}
	}
}