6.2016.物电学院 电气工程及其自动化 辛雅松 15050341033
2016-04-19 22:15
351 查看
一.用Timer算加法
Private Sub Timer1_Time
sum = sum + i
i = i + 1
If i > 100 Then
Me.Timer1.Ebable = Falze
Print sum
End Sub
二.阶乘算法
Private Sub Command1_Click()
Cls
Print
阶乘(12)
End Sub
Private Function
阶乘(n As Integer)As Long
If n = 1 Then
阶乘 = 1
Else
阶乘 = n ×
阶乘(n-1)
End If
End Function
三.两个
一位数
相乘
Private Sub Command1_Click()
Cls
Dim n1 As Byte
Dim n2 As Byte
Dim yushu As Byte
Dim shang As Byte
Dim tempResult As Byte
n1 = Int(Me.Text1.Text)
n2 = Int(Me.Text2.Text)
tempResult = n1*n2
yushu = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu
End up
四.两位数
乘
一位数
Private Sub Command1_Click()
Cls
Dim n1()
As Byte,n1len As Long
Dim n2()
As Byte,n2len As Long
Dim yushu1 As Byte,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) = 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(2)*n2(1)+shang
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(2)*n2(1)+shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu2 & yushu1
End up
一.用Timer算加法
Private Sub Timer1_Time
sum = sum + i
i = i + 1
If i > 100 Then
Me.Timer1.Ebable = Falze
Print sum
End Sub
二.阶乘算法
Private Sub Command1_Click()
Cls
阶乘(12)
End Sub
Private Function
阶乘(n As Integer)As Long
If n = 1 Then
阶乘 = 1
Else
阶乘 = n ×
阶乘(n-1)
End If
End Function
三.两个
一位数
相乘
Private Sub Command1_Click()
Cls
Dim n1 As Byte
Dim n2 As Byte
Dim yushu As Byte
Dim shang As Byte
Dim tempResult As Byte
n1 = Int(Me.Text1.Text)
n2 = Int(Me.Text2.Text)
tempResult = n1*n2
yushu = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu
End up
四.两位数
乘
一位数
Private Sub Command1_Click()
Cls
Dim n1()
As Byte,n1len As Long
Dim n2()
As Byte,n2len As Long
Dim yushu1 As Byte,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) = 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(2)*n2(1)+shang
yushu1 = tempResult Mod 10
shang = tempResult \ 10
tempResult = n1(2)*n2(1)+shang
yushu2 = tempResult Mod 10
shang = tempResult \ 10
Print shang & yushu2 & yushu1
End up
相关文章推荐
- 防御 XSS 的七条原则
- 仿真作业
- ZOJ 3609 Modular Inverse
- bzoj4539: [Hnoi2016]树
- C语言预处理指令学习笔记
- 软件工程中的6个阶段
- TCP协议的滑动窗口协议
- 初试->广义表
- ScrollView 滚动条知识点
- Java继承、多态面试题
- JavaScript浏览器检测
- linux操作系统的分类及解释
- 聊聊同步、异步、阻塞与非阻塞(转)
- 深入理解Servlet [转]
- 跨域资源共享 CORS 详解
- ZOJ 3607 Lazier Salesgirl
- 关于类模板语法的极简示例
- centos 添加用户
- 递归算法的解析
- 用windeployqt打包Release版本后提示错误