#include iostream.h
class stack{
private:
char items[max];
int top;
public:
stack(){top=-1;}
int empty()
{retu (top==-1?1:0);}
int full()
{retu (top==(max-1)?1:0);}
void push(char x)
{
if(full())
{
cout<<"stack is full";
retu;
}
items[++top]=x;
retu;
}
char pop()
{
if(empty())
{ cout<<"stack is empty";
retu 0;
}
retu (items[top--]);
}
};
main()
{
char y;
stack s;
cout<<"Enter your char:;
";
for(int a=0;a<10;a++)
{
cin>>y;
s.push(y);
برچسب:
نویسنده: حسین بنیادی
}
while(a>0)
{
cout<
}
retu 0;
}