Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define max 5
- struct pilha{
- int topo;
- int pilha[max];
- }p, aux;
- void mostrar (struct pilha *p, struct pilha *aux){
- if(p->topo != -1){
- for(int i = 0; p->topo >= i; p->topo--, aux->topo++){
- printf("%d\n", p->pilha[p->topo]);
- aux->pilha[aux->topo] = p->pilha[p->topo];
- }
- for(int i = 0; aux->topo >= 0; aux->topo--){
- p->pilha[p->topo] = aux->pilha[aux->topo];
- p->topo++;
- }
- }
- else
- printf("nao ha elementos a ser mostrado\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement