在VB中怎样利用自定义子过程计算1*2+2*3+3*4+4*5+5*6+6*7?

 我来答
草原上之狼
高粉答主

2020-04-10 · 醉心答题,欢迎关注
知道大有可为答主
回答量:2.9万
采纳率:93%
帮助的人:3936万
展开全部
Private Sub zgc(x, diff) Dim i As Integer For i = 3 To x If i Mod 2 Then diff = diff - 1 / i Else diff = diff + 1 / i End If Next iEnd SubPrivate Function zhs(x) As Double Dim i As Integer For i = 3 To x If i Mod 2 Then diff = diff - 1 / i Else diff = diff + 1 / i End If Next i zhs = diffEnd FunctionPrivate Sub Command1_Click() Dim diff As Double diff = 0 zgc Val(Text1.Text), diff Print "子过程:e5a48de588b67a686964616f31333332623364"; diff diff = 0 diff = zhs(Val(Text1.Text)) Print "子函数:"; diffEnd Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式