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
|
int startlong = 0;
int startlarg = 0;
int startvalue = 0;
int endlong = 0;
int endlarg = 0;
bool find1 = false;
bool find2 = false;
int i = 0;
while (i < tab.getlength(0) || (!find1 && !find2))
{
int j = 0;
while (j < tab.getlength(1) || (!find1 && !find2))
{
if (tab[i, j] > 0)
if (!find1)
{
find1 = true;
startlong = i;
startlarg = j;
startvalue = tab[i, j];
}
else if (tab[i, j] == value && !find2 && find1)
{
endlong = i;
endlarg=j;
}
}
i++;
}
for (int a=startlong; a<=endlong; a++)
{
tab[a, startlarg] = -startvalue;
}
for (int b=startlarg; b<=endlarg; b++)
{
tab[endlong, b] = -startvalue;
} |
Partager