Documentos de Académico
Documentos de Profesional
Documentos de Cultura
h>
#include<iostream.h>
#include<string.h>
//------------------------------ COLA
struct Fecha
{
int dia, mes, anio;
};
struct t_dato
{
Fecha elab;
int n_cuenta;
char operacion[20];
float monto;
};
typedef t_dato DATO;
struct NODO
{
DATO Info;
NODO *Sig;
};
typedef NODO* ptNODO;
// ------------------------------ FUNCIONES
void MENU()
{
clrscr();
cout<<"1) Agregar \n2) Mostrar Operaciones";
cout<<"\n3) Calcular depositos por fecha \n";
cout<<"4) Calcular el saldo de una cuenta\n";
cout<<"5) Salir \n";
}
void AGREGAR(ptNODO &Cola, DATO Elem)
{
ptNODO A=Cola, N;
N=new(NODO);
N->Info=Elem;
N->Sig=NULL;
if(Cola==NULL) Cola=N;
else
{
while(A->Sig!=NULL) A=A->Sig;
A->Sig=N;
}
}
int SACAR(ptNODO &Cola, DATO &Elem)
{
ptNODO A=Cola;
if(A!=NULL)
{
Cola=Cola->Sig;
Elem=A->Info;
delete(A);
return 1;
}
else return 0;
}