If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)) + 19, min(z(3), z(4)) + 8) = "-": s = s + 1
If p(z(3)) + n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)) + 19, min(z(3), z(4)) + 8) = "+"
If p(z(4)) - n(z(4), z(5)) = p(z(5)) Then Worksheets("Лист3").Cells(max(z(4), z(5)) + 19, min(z(4), z(5)) + 8) = "-": s = s + 1
If p(z(4)) + n(z(4), z(5)) = p(z(5)) Then Worksheets("Лист3").Cells(max(z(4), z(5)) + 19, min(z(4), z(5)) + 8) = "+"
If p(z(5)) - n(z(5), z(6)) = p(z(6)) Then Worksheets("Лист3").Cells(max(z(5), z(6)) + 19, min(z(5), z(6)) + 8) = "-": s = s + 1
If p(z(5)) + n(z(5), z(6)) = p(z(6)) Then Worksheets("Лист3").Cells(max(z(5), z(6)) + 19, min(z(5), z(6)) + 8) = "+"
End If
If p(a) > p(b) And a > b Then
If p(z(1)) - n(z(1), z(2)) = p(z(2)) Then Worksheets("Лист3").Cells(max(z(1), z(2)) + 19, min(z(1), z(2)) + 8) = "+"
If p(z(1)) + n(z(1), z(2)) = p(z(2)) Then Worksheets("Лист3").Cells(max(z(1), z(2)) + 19, min(z(1), z(2)) + 8) = "-": s = s + 1
If p(z(2)) - n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)) + 19, min(z(2), z(3)) + 8) = "+"
If p(z(2)) + n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)) + 19, min(z(2), z(3)) + 8) = "-": s = s + 1
If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)) + 19, min(z(3), z(4)) + 8) = "+"
If p(z(3)) + n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)) + 19, min(z(3), z(4)) + 8) = "-": s = s + 1
If p(z(4)) - n(z(4), z(5)) = p(z(5)) Then Worksheets("Лист3").Cells(max(z(4), z(5)) + 19, min(z(4), z(5)) + 8) = "+"
If p(z(4)) + n(z(4), z(5)) = p(z(5)) Then Worksheets("Лист3").Cells(max(z(4), z(5)) + 19, min(z(4), z(5)) + 8) = "-": s = s + 1
If p(z(5)) - n(z(5), z(6)) = p(z(6)) Then Worksheets("Лист3").Cells(max(z(5), z(6)) + 19, min(z(5), z(6)) + 8) = "+"
If p(z(5)) + n(z(5), z(6)) = p(z(6)) Then Worksheets("Лист3").Cells(max(z(5), z(6)) + 19, min(z(5), z(6)) + 8) = "-": s = s + 1
End If
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
w(i, j) = Worksheets("Лист3").Cells(i + 19, j + 8)
Next j
Next i
If s = 1 Then
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then l = postavka(i, j): k = i: r = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then postavka(i, j) = postavka(i, j) - l
If w(i, j) = "+" Then postavka(i, j) = postavka(i, j) + l
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
Worksheets("Лист1").Cells(i + 9, j) = postavka(i, j)
Next j
Next i
If a <= b Then
Worksheets("Лист1").Cells(k + 6, r + 8) = "."
End If
If a > b Then
Worksheets("Лист1").Cells(r + 6, k + 8) = "."
End If
End If
If s = 2 Then
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then l = postavka(i, j): k = i: r = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r Then l1 = postavka(i, j): k1 = i: r1 = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then postavka(i, j) = postavka(i, j) - min(l, l1)
If w(i, j) = "+" Then postavka(i, j) = postavka(i, j) + min(l, l1)
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
Worksheets("Лист1").Cells(i + 15, j + 8) = postavka(i, j)
Next j
Next i
If a <= b Then
If min(l, l1) = l Then Worksheets("Лист1").Cells(k + 6, r + 8) = "."
If min(l, l1) = l1 Then Worksheets("Лист1").Cells(k1 + 6, r1 + 8) = "."
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.