三位数乘一位数
来源:互联网 发布:ipadair2下载不了软件 编辑:程序博客网 时间:2024/05/17 06:48
Option Base 1
Private Sub Command1_Click()
Me.Font.Size = 70
Dim n1() As Byte, n1Len As Long
Dim n2() As Byte, n2Len As Long
Dim yushu1 As Byte, yushu2 As Byte, yushu3 As Integer
Dim shang As Byte
Dim tempResult As Byte
n1Len = Len(Me.Text1.Text)
n2Len = Len(Me.Text2.Text)
ReDim n1(n1Len)
ReDim n2(n2Len)
For i = LBound(n1) To UBound(n1)
n1(i) = Int(Val(Mid(Me.Text1.Text, i, 1)))
Next
For i = LBound(n2) To UBound(n2)
n2(i) = Int(Val(Mid(Me.Text2.Text, i, 1)))
Next
tempResult = n1(3) * n2(1)
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(2) * n2(1) + shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(1) * n2(1) + shang
yushu3 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu3 & yushu2 & yushu1
End Sub
Private Sub Command1_Click()
Me.Font.Size = 70
Dim n1() As Byte, n1Len As Long
Dim n2() As Byte, n2Len As Long
Dim yushu1 As Byte, yushu2 As Byte, yushu3 As Integer
Dim shang As Byte
Dim tempResult As Byte
n1Len = Len(Me.Text1.Text)
n2Len = Len(Me.Text2.Text)
ReDim n1(n1Len)
ReDim n2(n2Len)
For i = LBound(n1) To UBound(n1)
n1(i) = Int(Val(Mid(Me.Text1.Text, i, 1)))
Next
For i = LBound(n2) To UBound(n2)
n2(i) = Int(Val(Mid(Me.Text2.Text, i, 1)))
Next
tempResult = n1(3) * n2(1)
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(2) * n2(1) + shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(1) * n2(1) + shang
yushu3 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu3 & yushu2 & yushu1
End Sub
0 0
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 三位数乘一位数
- 15电气 李少振 三位数乘一位数程序
- 15 电气 齐振昊 VB中三位数乘一位数
- 一位数乘一位数
- 一位数乘一位数
- 一位数乘一位数
- vb一位数乘一位数阶乘
- 三位数乘以一位数
- 三位数成一位数
- 三位数乘以一位数
- 三位数乘以一位数
- Unity3d 中 UI 开发的 MVC 模式
- GEEK学习笔记— —程序员面试宝典笔记(三)
- Struts2动态调用方法报错
- js一维数组案例:小孩轮滑100米,算平均时间
- 华为2016实习生招聘笔试题第三题--和尚挑水
- 三位数乘一位数
- vb中的乘法运算
- 三位数乘以一位数
- http的get和post请求
- 读《CSS.Secrets》,记录下——box-shadow,outline
- 两位数乘一位数
- SourceTree里GitFlow的使用
- 多位数乘一位数
- 唱衰平板何以成风?坚守品质乃长胜之道