= 0 then Form2. StringGrid2. Cells [j, i]: ='' Form2. StringGrid2. Cells [j, i]: = IntToStr (mas [i, j]);: = sum1 + mas [i, j] * koef [i, j];;. Edit2. Text: = IntToStr (sum1);: = 0; _max: = 0; i: = 0 to k-1 domassiv [i] <> 0 thenabs (max)
begin_max: = massiv [i];// номер максимального за модулем контуру з нуля
max: = contur [massiv [i], rc * cc * 2-1];
end;; (nom_max);; TForm1. raspred_metod (mas12: arr);
var, j, q, w, rc, cc: integer;// змінні для масиву
begin: = Form2. StringGrid1. RowCount-2;: = Form2. StringGrid1. ColCou nt-2; i: = 1 to rc doj: = 1 to cc do [i, j]: = mas12 [i, j]; i: = 1 to rc doj: = 1 to cc domas [i, j] = 0 then: = k +1; (contur, k, rc * cc * 2); (aPath, rc * cc * 2); q: = 0 to Length (aPath) - 1 do aPath [q]: = 0; (i, j);// знаходимо контур
// Form2. Memo1. Lines. Add ('Контур' + IntToStr (i) + '' + IntToStr (j));
// Form2. Memo1. Lines. Add ('Осередки:'); q: = k-1 to k-1 do: =''; w: = 0 to rc * cc * 2-1 doaPath [w] <> 0 then [q, w ]: = aPath [w];: = s + IntTostr (contur [q, w]) + '';;
// Form2. Memo1. Lines. Add (s);;;;: = -1; i <= k-1 do: = i +1;: = 0;: = 2; j <= rc * cc * 2-3 do (i <= k -1) and (contur [i, j] <> 0) and (contur [i, j +1] <> 0) thenq mod 2 <> 0 then koef2 [contur [i, j], contur [i, j +1]]: = koef [contur [i, j], contur [i, j +1]] * (-1) koef2 [contur [i, j], contur [i, j +1 ]]: = koef [contur [i, j], contur [i, j +1]]; [i, rc * cc * 2-1]: = contur [i, rc * cc * 2-1] + koef2 [contur [i, j], contur [i, j +1]];;: = j +2;: = q +1;;; ();; TForm1. sum_pot (StringGrid: TStringGrid): integer;, j: integer;: = 0; i: = StringGrid. ColCount-1 to StringGrid. ColCount-1 doj: = 1 to StringGrid1. RowCount-1 do: = result + StrToIntDef (StringGrid. Cells [i, j], 0);; TForm1. sum_proiz (StringGrid: TStringGrid): integer;, j: integer;: = 0; i: = 1 to StringGrid. ColCount-1 doj: = StringGrid1. RowCount-1 to StringGrid1. RowCount-1 do: = result + StrToIntDef (StringGrid. Cells [i, j], 0);; TForm1. StringGrid1DrawCell (Sender: TObject; ACol, ARow: Integer;: TRect; State: TGridDrawState);
// забарвлення останнього стовпця і останнього рядка StringGrid1 в помаранчевий цветArow = StringGrid1. RowCount-1 then. Canvas. Brush. Color: = clHighlight;// колір. Canvas. FillRect (Rect);// Зафарбовуємо задній фон. Canvas. TextOut (Rect. Left, Rect. Top, StringGrid1. Cells [Acol, Arow]);// зафарбовуємо текст, і вирівнювання тексту
end; ACol = StringGrid1. ColCount-1 then. Canvas. Brush. Color: = clHighlight;. Canvas. FillRect (Rect);. Canvas. TextOut (Rect. Left, Rect. Top, StringGrid1. Cells [Acol, Arow]);;; TForm1. StringGrid1KeyPress (Sender: TObject...