lunes, 12 de septiembre de 2011



Diagrama:
image581.jpg
Programa:
#include <conio.h>

#include <iostream.h>

void Recorrido(char Info[8][2],int Indice[8],int Inicio,int Disp);

void main()

{

char Info[8][2]={{"G"},{"I"},{" "},{"T"},{"O"},{"A"},

{" "},{"T"}};

int Indice[8]={5,7,6,1,-999,3,-999,4};

int Inicio=0,Disp=2;

cout<<"El Recorrido es:\n";

Recorrido(Info,Indice,Inicio,Disp);

getch();

}

void Recorrido(char Info[8][2],int Indice[8],int Inicio,int Disp)

{

int Apuntador=Inicio;

while(Apuntador!=-999)

{

cout<<Info[Apuntador];

Apuntador=Indice[Apuntador];

}

}

Corrida:
image582.jpg

No hay comentarios:

Publicar un comentario