Sub m2()
Cells.Clear
Dim n As Integer, i As Integer, min As Integer
n = InputBox("n(>5) = ")
Cells(1, 1).Value = "n = " + Str(n)
ReDim a(1 To n)
For i = 1 To n
a(i) = InputBox("a(" + Str(i) + ")")
Next i
Cells(2, 1).Value = "Исходный массив"
Range(Cells(3, 1), Cells(3, n)).Value = a
min = a(1)
For i = 2 To n
If a(i) < min Then min = a(i)
Next i
Cells(4, 1).Value = "min = " + Str(min)
Cells(5, 1).Value = "Полученный массив"
For i = n - 4 To n
a(i) = min
Next i
Range(Cells(6, 1), Cells(6, n)).Value = a
End Sub