stack في c++ ما هو خطا
#include <iostream.h>
void main()
{
int s[5],item,top=-1,c,i;
do
{
cout<<"pash=1,pop=2,exit=3"<<"\n";
cout<<"choose you option\n";
cin>>c;
if(c==1)
cout<<"enter number to pash/n";
cin>>item;
if(item==4)
cout<<"the Stak is full\n";
else
{
top++;
s[top]=item;
cout<<"the stack is ";
for(i=top;i>=0;i--)
cout<<s<<" ";
cout<<"\n\n\n";
}
}
if(c==2)
cout<<"enter number to pop\n";
cin>>item;
if(top==-1)
cout<<"stack is empty\n";
else
{
item=s[top];
cout<<"the popped item is"<<item;
top--;
cout<<"\n\n stack";
for(i=top;i>0;i--)
cout<<s<<" ";
cout<<"\n";
}while(c<=2);
}