If ((a = 2 And b = 6) Or (a = 6 And b = 2)) And p(2) > p(6) Then z(1) = 2: z(2) = 5: z(3) = 3: z(4) = 6
If ((a = 2 And b = 5) Or (a = 5 And b = 2)) And p(2) <= p(5) Then z(1) = 5: z(2) = 3: z(3) = 6: z(4) = 2
If ((a = 2 And b = 5) Or (a = 5 And b = 2)) And p(2) > p(5) Then z(1) = 2: z(2) = 6: z(3) = 3: z(4) = 5
If ((a = 3 And b = 5) Or (a = 5 And b = 3)) And p(3) <= p(5) Then z(1) = 5: z(2) = 2: z(3) = 6: z(4) = 3
If ((a = 3 And b = 5) Or (a = 5 And b = 3)) And p(3) > p(5) Then z(1) = 3: z(2) = 6: z(3) = 2: z(4) = 5
Worksheets("Лист3").Cells(min1(a, b), max1(a, b)) = "+"
s = 0
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(min(z(1),z(2)), max(z(1), z(2))) = "-":s=s + 1
If p(z(1)) + n(z(1), z(2)) = p(z(2)) Then Worksheets("Лист3").Cells(min(z(1), z(2)), max(z(1), z(2))) = "+"
If p(z(2)) - n(z(2), z(3))= (z(3)) Then Worksheets("Лист3").Cells(min(z(2),z(3)), max(z(2), z(3)))="-":s =s + 1
If p(z(2)) + n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(min(z(2), z(3)), max(z(2), z(3))) ="+" If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(min(z(3), z(4)), max(z(3), z(4))) = "-": s = s + 1
If p(z(3)) + n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(min(z(3), z(4)), max(z(3), z(4))) ="+" 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(min(z(1), z(2)), max(z(1), z(2))) = "+"
If p(z(1)) + n(z(1), z(2))=p(z(2)) Then Worksheets("Лист3").Cells(min(z(1),z(2)),max(z(1),z(2)))="-":s = s + 1
If p(z(2)) - n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(min(z(2), z(3)), max(z(2), z(3))) = "+"
If p(z(2)) + n(z(2),z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(min(z(2),z(3)),max(z(2),z(3))) ="-":s=s + 1
If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(min(z(3), z(4)), max(z(3), z(4))) = "+"
If p(z(3))+n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(min(z(3), z(4)),max(z(3), z(4)))="-":s=s + 1
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)), min(z(1), z(2))) ="-":s=s+ 1
If p(z(1)) + n(z(1), z(2)) = p(z(2)) Then Worksheets("Лист3").Cells(max(z(1), z(2)), min(z(1), z(2))) = "+"
If p(z(2)) - n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)), min(z(2), z(3))) ="-":s=s+
If p(z(2)) + n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)), min(z(2), z(3))) = "+"
If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)), min(z(3), z(4)))="-":s=s+1
If p(z(3)) + n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)), min(z(3), z(4))) = "+"
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)), min(z(1), z(2))) = "+"
If p(z(1)) + n(z(1), z(2)) = p(z(2)) Then Worksheets("Лист3").Cells(max(z(1),z(2)), min(z(1), z(2)))="-":s=s+1
If p(z(2)) - n(z(2), z(3)) = p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)), min(z(2), z(3))) = "+"
If p(z(2))+n(z(2),z(3))=p(z(3)) Then Worksheets("Лист3").Cells(max(z(2), z(3)),min(z(2), z(3)))= "-":s = s + 1
If p(z(3)) - n(z(3), z(4)) = p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)), min(z(3), z(4))) = "+"
If p(z(3)) + n(z(3), z(4)) =p(z(4)) Then Worksheets("Лист3").Cells(max(z(3), z(4)),min(z(3), z(4)))="-":s=s+ 1
End If
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.