#define MAX 8
#include <stdio.h>
#include <conio.h>
int top=0;
char pila[MAX];
void push(char i);
char pop (void);
void Listar(void);
void alex (void);
main()
{
printf("\t\t***Palindromo***\n\n");
printf("Inserta Las Letras\n");
char let;
int x,y;
for(x=0;x<MAX;x++)
{
printf("ESCRIBE LA LETRA %d: ",x+1);
fflush(stdin);
scanf("%c", &let);
push(let);
}
Listar();
for(y=top;y>0;y--)
printf("LA LETRA ESCRITAS FUERON: %c\n",pop());
alex();
getch();
}
char pop (void){
top--;
if(top<0)
{
printf("MEMORIA VACIA");
return(0);
}
return pila[top];
}
void push (char i){
if(top>=MAX)
{
printf("PILA LLENA");
return;
}
pila[top]=i;
top++;
}
void Listar (void){
int i;
for(i=0;i<top;i++)
printf("Letra: %c\n",pila[i]);
getch();
}
void alex(void)
{
printf("\n\nAlejandro Gonzalez Arteaga\n");
printf("Grupo: 110352\tMatricula:1311120069\n");
printf("Informatica\n\n");
}





