| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 464 人关注过本帖
标题:连加求和问题
只看楼主 加入收藏
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
快速回复:连加求和问题
数据加载中...
 
   



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

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