#include<iostream> using namespace std; // void push(int x); int pop(); bool isEmpty(); bool isFull(); // int A[5010],top=0; int main() { push(50); cout<<pop()<<endl; cout<<top; } void push(int x) { if(isFull) { A[top]=x; top++; } } int pop() { if(isEmpty) { top--; return A[top]; } } bool isEmpty() { if(A[top]==0) return 0; else return 1; } bool isFull() { if(top==5000) return 0; else return 1; }
原文地址:https://www.cnblogs.com/incotnigo/p/8453419.html
时间: 2024-11-02 08:21:18