1樓:匿名使用者
注:下面的方法,沒有判斷是否有重複的最大數private sub form_click()dim m as integer, n as integer, a() as integer
dim maxi as integer, maxj as integer
m = 5
n = 6
redim a(1 to m, 1 to n) as integermaxi = 1
maxj = 1
clsfor i = 1 to m
for j = 1 to n
a(i, j) = int(rnd * 900) + 100if a(maxi, maxj) < a(i, j) thenmaxi = i
maxj = j
end if
print a(i, j) & " ";
next
next
print "最大的數為:" & a(maxi, maxj) & " 位置在:(" & maxi & "," & maxj & ")"
end sub
VB程式設計題目,vb程式設計題目
private sub mand1 click dim i as integer,j as integer,k as integer dim a 1 to 10 as integerdim max as integer,min as integer,pj as single dim sumnum a...
vb程式設計問題,VB程式設計問題
private sub command1 click text1 for i 1 to 45 7 for j 1 to 45 6 2for k 1 to 45 3 5if i j 2 k 5 45 thenn n 1 end if next next next text1 n end sub pri...
VB程式設計問題,VB程式設計難嗎?
非常簡單,你看插圖,一切都在圖中。如下 在窗體中新增一個label1 兩個預設command1和command2。一切屬性預設 不用修改。private sub command1 click if command1.caption 有邊框 then label1.borderstyle 1 comm...