标题:连加求和问题
只看楼主
yuiolivia
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2005-12-5
 问题点数:0 回复次数:1 
连加求和问题
Dim x, y, a, b, i, tem As Single
i = TextBox1.Text
If TextBox1.Text = "" Then
MessageBox.Show("请输入数!")
ElseIf TextBox1.Text = i Then
x=2 y=4
While i = 0 i <= 6 i++
a = x * y
b = (x - 1) * (y - 1)
tem = a / b
x = x + 2
y = y + 2
End While
End If
tem = TextBox2.Text
怎么写都出错,高手们帮看看~谢谢
搜索更多相关主题的帖子: 求和 
2006-10-02 10:59
梓风
Rank: 2
等 级:新手上路
威 望:4
帖 子:181
专家分:0
注 册:2006-10-22
得分:0 
Private Function count() As Single
i = TextBox1.Text
If TextBox1.Text = "" Then
MessageBox.Show("请输入数!")
ElseIf TextBox1.Text = i Then
x = 2
y = 4
For i = 0 To 6
a = x * y
b = (x - 1) * (y - 1)
tem += a / b
x = x + 2
y = y + 2
Next
End If
Return tem
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox2.Text = count()
End Sub

等待相逢
2006-10-24 15:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-93945-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047337 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved