24.06.2013 Views

Télécharger (5Mb) - Université du Québec à Trois-Rivières

Télécharger (5Mb) - Université du Québec à Trois-Rivières

Télécharger (5Mb) - Université du Québec à Trois-Rivières

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

j + 1 ;<br />

for (int j = 0 ; j < nbColonnes ; j++)<br />

{<br />

if (grille[i , j] == 1)<br />

grille li , j] i * nbColonnes +<br />

Il Itération pour mettre toutes les cellules d ' une<br />

composante connexe au maximum de la composante<br />

Il L ' itération s ' arrête quand il n ' y a plus de<br />

modification<br />

bool modif = true ;<br />

while (modif)<br />

{<br />

modif = false ;<br />

for (int i = 0 ; i < nbLignes ; i++)<br />

{<br />

for (int j 0; j < nbColonnes ; j++)<br />

{<br />

if (grille[i, j] > 0)<br />

{<br />

if (i>O)<br />

if (grille[i- 1 , j] ><br />

grille li, j] )<br />

grille [i- 1 , j] ;<br />

grille li, j] )<br />

grille [i+1 , j] ;<br />

grille li, j])<br />

grille li, j - 1] ;<br />

grille li , j])<br />

grille li , j+1] ;<br />

grille[i , j] =<br />

modif = true ;<br />

if (i <br />

grille[i, j] =<br />

modif = true ;<br />

}<br />

if (j>O)<br />

if (grille[i , j - 1] ><br />

grille[i , j] =<br />

modif = true ;<br />

if (j<br />

grille[i, j] =<br />

modif = true ;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!