1樓:匿名使用者
你的題目不完整,不知道你的陣列中的數,是不是一個等差數列,如果是的話,按下面的方法來做,隨便給出兩個位置,及相應的值,即可算出平均值
private sub command1_click()dim a(1 to 10) as doublem = 4
a(m) = 1.667
n = 10
a(n) = 3.333
step = (a(n) - a(m)) / (n - m)s = a(m)
for i = m - 1 to 1 step -1a(i) = a(i + 1) - steps = s + a(i)
next
for i = m + 1 to 10
a(i) = a(i - 1) + steps = s + a(i)
next
print s / 10
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...