Professional Documents
Culture Documents
Wa0001
Wa0001
}
//back:
bool Pop(int i)
{
if(i==-1)
return true;
else
return false;
}
int main()
{
int top=-1;
int x;
int a[100];
cout<<"enter the size of element"<<endl;
cin>>x;
}
}
o:
cout<<"the elemnts after enter"<<endl;
for(int j=0;j<x;j++)
{
cout<<a[top]<< endl;
top--;
}
top=x-1;
// for delete
cout<< " delete the elemnt in the stack array"<<endl;
int y;
first:
if(Pop(top)== true)
{
cout<<"is emity"<<endl;
goto out;
}
else
{
insid:
cout<<"enter the last elemnt"<<endl;
cin>>y;
cout<<"___________________________"<<endl;
if (y!=a[top])
{
cout<<"most be enter the last elemnt "<<endl;
goto insid;
}
else
{
int z=top-1;
cout<<" after delete "<<endl;
for(int i=0; i<top;i++)
{
cout<<a[z]<<endl;
z--;
}
cout<<"..........................."<<endl;
top--;
goto first;
}
}
out:
system("pause");
return 0;
}