Contoh Rumus Sederhana Stack # include <iostream.h> #include<stdio.h> # define MAX 5 #define true 1 #define false 0 char stack[MAX]; int top; void init(void); int full(void); int empty(void); char pop(void); void clear(void); void push(char info); void baca(void); void main() { char pilih,elm; cout<<"demo operasi single stack"<<endl; init(); do { cout<<"OPERASI SINGLE STACK :"<<endl; cout<<"[1]PUSH"<<endl; cout<<"[2]POP"<<endl; cout<<"[3]clear"<<endl; cout<<"[4]BACA"<<endl; cout<<"[5]selesai"<<endl; cout<<"pilihan:";cin>>pilih; switch(pilih) { case '1':cout<<"PUSH-->";cin>>elm; push(elm); break; case '2':elm=pop(); cout<<"pop"<<elm; break; case '3':clear(); break; case '4':baca(); break; case '5':break; defa...
Postingan
Menampilkan postingan dari Desember, 2017