Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CODE.h
- #include<iostream>
- struct nodo {
- char chiave;
- nodo *next;
- nodo(char c='\0', nodo* n=NULL);
- };
- struct coda {
- nodo *inizio;
- nodo *fine;
- coda(nodo * t= NULL, nodo* f = NULL);
- };
- void push(char c, coda &Q);
- char pop(coda &Q);
- bool e_vuota(coda Q);
- //main.cpp
- #include <iostream>
- #include "code.h"
- using namespace std;
- int main()
- {
- coda Q = new coda();
- cout << "start" << endl;
- char c;
- bool check = true;
- while (check){
- cin>>c;
- switch(c){
- case '*':
- cout<<pop(Q)<<" ";
- break;
- case'.':
- check = false;
- break;
- default:
- push(c,Q);
- break;
- }//swtich
- }//check */
- cout << "end" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement