VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)

VB爱好者乐园(VBGood)

 找回密码
 立即注册
搜索
查看: 456|回复: 0

求助.减法和除法怎么改

[复制链接]
发表于 2017-10-22 22:46:39 | 显示全部楼层 |阅读模式
这个是我们的作业,就这个模板,减法和除法怎么写,呃呃呃不会发图片,我把代码发上来吧
Option Explicit
Dim m, n, o, h As String
Dim r, i, s, q, p, j As Integer
Private Sub Command1_Click()
m = Text1.Text
n = Text2.Text
p = 0
If Len(m) < Len(n) Then
r = Len(n) + 1: o = "0" & n: n = m: m = o
Else
r = Len(m) + 1: m = "0" & m
End If
Do
n = "0" & n
Loop Until Len(n) = r
For i = r To 1 Step -1
If q < 10 Then
p = 0
Else
p = 1
End If
q = Val(Mid(m, i, 1)) + Val(Mid(n, i, 1)) + p
s = s & CStr(q Mod 10)
Next i
For j = r To 1 Step -1
h = h & Mid(s, j, 1)
Next j
If q >= 10 Then
Text3.Text = h
Else
Text3.Text = Right(h, r - 1)
End If
End Sub

文字版|手机版|小黑屋|VBGood  

GMT+8, 2019-7-21 08:51

VB爱好者乐园(VBGood)
快速回复 返回顶部 返回列表