Red de conocimiento informático - Consumibles informáticos - Programación de cierre

Programación de cierre

Lo corregí yo mismo usando escritura orientada a objetos.

# include & ltiostream.h & gt

Plantilla & clase ltT& gt

void Warshall(T *a, int m, int n)

{

int i = 0, j = 0

for(I = 0;i<n;i++)

{

for(j = 0; j & ltm; j++)

{

if( a[j][i] == 1)

{

int k = 0;

for(int x = 0; x & ltn; x++)

{

a[ j][k]= a[j][k]| a[I][k];

k++;

}

}

}

}

for(I = 0;i<m;i++)

{

for(j = 0; j & ltn; j++)

{

cout & lt& lta[I][j]& lt;& lt\ t ';

}

cout & lt& ltendl

}

}

void main()

{

int ai[4][4] = { {0, 1, 0, 0}, {1, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, 0, 0 } };

Warshall(ai, 4, 4)

}

;