![;-) ;-)](https://forum.elhacker.net/Smileys/navidad/aplaudir.gif)
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#include <iostream>
#include <conio.h>
#include <stdlib.h>
int main ()
{
int a [2][2]={{2,4},{6,8}};
int *p =new int [2][2];
for (int i=0; i<2; i++)
{
cout <<*(a+i) <<endl;
}
for (int j=0; j<2; j++)
{
cout <<*(a+j) <<endl;
}
getche ();
delete [][]p;
return 0;
}
//IMPLEMENTA UNA PILA
# include <iostream.h>
# include <conio.h>
# include <stdlib.h>
struct pilas
{
int x;
}pi[3];
//prototipos de función
void llenar(pilas);
int extraer(pilas);
int tope=-1;
int main()
{
cout<<"LLENAR PILA"<<endl;
while(tope<3)
{
for (int i=0; i<3; i++)
{
cin>>pi[i].x;
llenar (pi[i]);
}
}
cout<<"Pulsar cualquier tecla para continuar";
getche();
system ("CLS");
cout<<"Datos de la pila"<<endl;
for (int i=0; i<3; i++)
{
cout <<pi[i].x;
extraer(pi[i]);
}
getche ();
return 0;
} //fin de main
void llenar(pilas)
{
if(tope+1 >=3)
cout<<"Pila llena"<<endl;
pi[++tope]=pi[3];
}
int extraer(pilas)
{
while(tope>=0)
{
for (int i=0; i<3; i++)
{
pi[--tope]=pi[3];
getche ();
}
if(tope==-1)
cout<<"Pila vacia";
}
return 0;
}
//IMPLEMENTA UNA PILA
# include <iostream.h>
# include <conio.h>
# include <stdlib.h>
struct pilas
{
int x;
}pi[3];
//prototipos de función
void llenar(pilas);
int extraer(pilas);
int tope=-1;
int main()
{
cout<<"LLENAR PILA"<<endl;
while(tope<3)
{
for (int i=0; i<3; i++)
{
cin>>pi[i].x;
llenar (pi);
}
}
cout<<"Pulsar cualquier tecla para continuar";
getche();
system ("CLS");
cout<<"Datos de la pila"<<endl;
extraer(pi);
getche ();
return -9;
}//fin main()
void llenar(pilas)
{
if(tope+1 >=3)
cout<<"Pila llena"<<endl;
pi[++tope]=pi[3];
}
int extraer(pilas)
{
while(tope>=0)
{
for (int i=0; i<3; i++)
{
cout <<pi[i].x;
cout<<pi[tope--]<<endl;
}
getche ();
if(tope==-1)
cout<<"Pila vacia";
}
}