看看下面这个vb 能否帮我改改 我知道问题很大

[复制链接]
查看11 | 回复3 | 2011-7-12 19:08:52 | 显示全部楼层 |阅读模式
Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single, d As Single, e As Single, v As Single
Dim u(0) As Integer

Max = u(0)

For a = 0 To 1 Step 0.05

For b = 0 To 1 Step 0.05

For c = 0 To 1 Step 0.05

For d = 0 To 1 Step 0.05

For e = 0 To 1 Step 0.05



v = a + b + c + d + e

If v = 1 Then

Text1.Text = a & vbCrLf

Text2.Text = b & vbCrLf

text3.Text = c & vbCrLf

Text4.Text = d & vbCrLf

Text5.Text = e & vbCrLf

End If



w = 0

w = w + 1



x = a * f + b * g + c * h + d * i + e * j

z = x * y



k = (a * f) / x

l = (b * g) / x

m = (c * h) / x

n = (d * i) / x

o = (e * j) / x



Text11.Text = x

Text13.Text = z

Text14.Text = k

Text15.Text = l

Text16.Text = m

Text17.Text = n

Text18.Text = o



u(w) = k * p + l * q + m * r + n * s + o * t



If u(w) >= Max Then

Max = u(w)

End If

Text1.Text = a

Text2.Text = b

text3.Text = c

Text4.Text = d

Text5.Text = e

Text24.Text = Max
Next e

Next d

Next c

Next b

Next a
End Sub

回复

使用道具 举报

千问 | 2011-7-12 19:08:52 | 显示全部楼层
请问你要实现什么...
回复

使用道具 举报

千问 | 2011-7-12 19:08:52 | 显示全部楼层
文章语言优美,不错~ 情有独钟你打错了!还有,写小溪是为了突出什么呢?有什么美好的回忆呢?还是你要学习小溪的意志呢?请点明主旨,确定目标,让人们从小溪中拾取回忆,学会坚强,欣赏你的文章...
回复

使用道具 举报

千问 | 2011-7-12 19:08:52 | 显示全部楼层
Private Sub Command1_Click()Dim a As Single, b As Single, c As Single, d As Single, e As Single, v As SingleDim u(0) As Integer
Max = u(0)
For a = 0 To 1 Step 0...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行