Предмет: Информатика, автор: Khadi16

Срочнооо ,помогите плиз 50 баллов( составить в QBasic

Приложения:

answer2020: Qbasic в DOS эмуляторе - неудобно. Может в Excel VBA?
Khadi16: Можно

Ответы

Автор ответа: answer2020
0

Function func32655135_1(a As Range) As Integer

Dim starting_row, final_row, starting_column, final_column, i, j, signum, s As Integer

starting_row = a.Row

final_row = starting_row + a.Rows.Count - 1

starting_column = a.Column

final_column = starting_column + a.Columns.Count - 1

s = 0

For i = starting_row To final_row

signum = 1

For j = starting_column To final_column

signum = signum * Abs(Sgn(Cells(i, j)))

Next

s = s + signum

Next

func32655135_1 = a.Rows.Count - s

End Function

Function func32655135_2(a As Range) As String

Dim starting_row, starting_column, i, j, yes_no As Integer

Dim answer(2) As String, r As Range

answer(0) = "No": answer(1) = "Yes"

starting_row = a.Row

starting_column = a.Column

For Each r In a

i = r.Row - starting_row + 1

j = r.Column - starting_column + 1

If j >= i Then GoTo label1

yes_no = (1 - Sgn(r.Value)) \ 2

If yes_no Then Exit For

label1:

Next

func32655135_2 = answer(yes_no)

End Function

Function func32655135_3(a As Range, b As Integer) As String

Dim starting_row, final_row, starting_column, final_column, i, j, signum, s As Integer

Dim answer(2) As String

answer(0) = "No": answer(1) = "Yes"

starting_row = a.Row

final_row = starting_row + a.Rows.Count - 1

starting_column = a.Column

final_column = starting_column + a.Columns.Count - 1

For j = starting_column To final_column

yes_no = 1 - Abs(Sgn(b - Application.max(Range(Cells(starting_row, j), Cells(final_row, j)))))

If yes_no Then Exit For

Next

func32655135_3 = answer(yes_no)

End Function

Excel VBA


Кабан2003: https://znanija.com/task/32695046 помогите
Кабан2003: https://znanija.com/task/32697033 очень срочно помогите
Похожие вопросы
Предмет: Математика, автор: rain0313
Предмет: Математика, автор: dwgf
Предмет: Математика, автор: Макарошка2001