Akina Можно и без динамического массива Например так ...
| Код | Public mas () As integer Public index_i, index_j As integer Public element As integer
Function find_kol(temp As integer) As integer Dim i, j As integer Dim Kol as integer Kol=0 For i=1 to M For j=1 to N if mas(i,j)=temp then Kol=Kol+1 End If Next j Next i find_kol=Kol End Function
Private Sub Poisk() Dim i, j As Integer Dim max_kol, kolich As integer max_kol=0 For i=1 to M For j=1 to N kolich=find_kol(mas(i,j)) if kolich>max_kol then max_kol=kolich : element=mas(i,j) index_i=i : index_j=j End if Next j Next i End Sub
| |