1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| int estvide(int col, char **m, int n )
{
int Test=1; int i=0;
while (Test==1 && i<n)
{
if (m[i][col]=='*') Test=0;
else i++;
}
return Test;
}
void supprimer( int lig, char **m, int n)
{
for (int j=0;j<n;j++) m[lig][j]='@';
}
int existezero(int t[],int n)
{
int trouve=0;
int i=0;
while(i<n && trouve==0)
{
if (t[i]==0) trouve=1;
else i++;
}
return trouve;
}
void RemplirPlusTOT (char **m, int n, int RPTOT[], int *rangMaxi)
{
int i,j;
for (i=0;i<n;i++) RPTOT[i]=0;
*rangMaxi=1;
do {
for (j=0;j<n;j++)
{
if ( estvide(j,m,n)==1 && RPTOT[j]==0)
{
RPTOT[j]=(*rangMaxi);
supprimer(j,m,n);
}
}
printf("\n testing ..\n"); // lors de ce test la boucle do tourne seulement 2 fois
(*rangMaxi)=(*rangMaxi)+1; // donc le max des rang je l'ai est 2 et c'est faux
} while (existezero(RPTOT,n)==1); /*la problème alors existe existezero()*/
} |
Partager