两位数乘一位数
2016-04-14 17:18
176 查看
Option Base 1
Private Sub Command1_Click()
Me.Font.Size = 30
Dim n1() As Byte, n1len As Long
Dim n2() As Byte, n2len As Long
Dim yushu1 As Byte
Dim yushu2 As Byte
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) = Mid(Me.Text1.Text, i, 1)
Next
For i = LBound(n2) To UBound(n2)
n2(i) = Mid(Me.Text2.Text, i, 1)
Next
tempResult = n1(2) * n2(1) + shang
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(1) * n2(1) + shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu2 & yushu1
End Sub
Private Sub Command1_Click()
Me.Font.Size = 30
Dim n1() As Byte, n1len As Long
Dim n2() As Byte, n2len As Long
Dim yushu1 As Byte
Dim yushu2 As Byte
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) = Mid(Me.Text1.Text, i, 1)
Next
For i = LBound(n2) To UBound(n2)
n2(i) = Mid(Me.Text2.Text, i, 1)
Next
tempResult = n1(2) * n2(1) + shang
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(1) * n2(1) + shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu2 & yushu1
End Sub
相关文章推荐
- 物流路径规划用遗传算法解决实例
- logstash问题:Could not find any executable java binary.
- [hihoCoder 1150] 基站选址(几何题,中心点)
- 2*1的运算
- 计算机图形学(二)输出图元_1_OpenGL画点函数
- 258.LeetCode Add Digits(easy)[数学问题 求一个数的树根]
- 【一天一道LeetCode】#17. Letter Combinations of a Phone Number
- 使用MFC DLL中的资源
- 【一天一道LeetCode】#17. Letter Combinations of a Phone Number
- 数据库分区的了解
- 收藏的iOS技术站点汇总(持续更新ing)
- eclipse出现每次修改代码报heap over错误,然后必须重启tomcat问题,修改过程
- S5PV210时钟,看门狗定时器
- node js
- 进程内核棧作用
- Linux入侵检查实用指令
- Zookeeper的安装和配置(单机模式)
- 学习新技能的37个最佳网站 - levy_cui 博客 - 博客频道 - CSDN.NET http://blog.csdn.net/levy_cui/article/details/51151224
- Winfrom TextBox默认提示信息
- 如何保证service不被杀掉