鞍点程序
2016-06-02 17:14
316 查看
Option Base 1
Private Sub Command1_Click()
Cls
Me.Font.Size = 30
Dim anma() As Integer
Dim m As Integer, n As Integer
m = 5: n = 6
ReDim anma(m, n)
Dim i As Integer, j As Integer
For i = 1 To m
For j = 1 To n
anma(i, j) = 10 + Int(Rnd() * 90)
Next j
Next i
For i = 1 To m
For j = 1 To n
Print anma(i, j); Spc(3);
Next j
Print
Next i
Dim row_max As Integer, column_max As Integer
For i = 1 To m
row_max = anma(i, 1)
column_max = 1
For j = 2 To n
If anma(i, j) > row_max Then
row_max = anma(i, j)
column_max = j
End If
Next j
For k = 1 To m
If anma(k, column_max) < row_max Then
Exit For
End If
Next k
If k = m + 1 Then
Print "鞍点:" & i & "," & column_max
End If
Next i
End Sub
Private Sub Command1_Click()
Cls
Me.Font.Size = 30
Dim anma() As Integer
Dim m As Integer, n As Integer
m = 5: n = 6
ReDim anma(m, n)
Dim i As Integer, j As Integer
For i = 1 To m
For j = 1 To n
anma(i, j) = 10 + Int(Rnd() * 90)
Next j
Next i
For i = 1 To m
For j = 1 To n
Print anma(i, j); Spc(3);
Next j
Next i
Dim row_max As Integer, column_max As Integer
For i = 1 To m
row_max = anma(i, 1)
column_max = 1
For j = 2 To n
If anma(i, j) > row_max Then
row_max = anma(i, j)
column_max = j
End If
Next j
For k = 1 To m
If anma(k, column_max) < row_max Then
Exit For
End If
Next k
If k = m + 1 Then
Print "鞍点:" & i & "," & column_max
End If
Next i
End Sub
相关文章推荐
- 牛腩新闻发布系统——发布过程中遇到的一些问题
- scrollTo,scrollBy,smoothScrollBy,smoothScrollTo
- 直接选择排序和它的优化
- AForm — 模型驱动的自动化表单解决方案
- 异常总结<经典例题>
- [置顶] input file上传图片预览(查看图片大小,类型,名字)------------------------------自己动手写jQuery插件
- 找出二维数组 n*m中的“鞍点”
- SwipeRefreshLayout初体验
- php array_map与array_walk使用对比
- 随笔(2016.05)
- DevExpress 2016.1正式将TreeMap Control加入WinForms版
- 8.1数组作数据成员
- codeforces 677A Vanya and Fence(水题)
- #14 – Page-Based Navigation(基于网页的应用程序)
- java interview 2
- error: command 'gcc' failed with exit status 1
- CODIS2.x集群 之 存储集群搭建全过程
- 设计模式之建造者模式(C++实现)
- Centos6.5下源码搭建lnmp环境
- Spring AOP AspectJ Pointcut Expressions With Examples--转