- 博客(13)
- 收藏
- 关注
原创 素数
代码如下: Private Function Judge() Dim b As Integer b = b / 1 * b End Function Private Sub Command1_Click() Dim a As Integer, b As Integer Show a = 0: b = 1 If Judge(b Do a = a + b b = b + 1
2012-05-08 21:03:43
316
原创 判断整除并求和
代码如下: Private Sub Command1_Click() Dim m As Integer, n As Integer, d As Integer Dim s As Long m = Val(Text1.Text) n = Val(Text2.Text) d = Val(Text3.Text) s = 0 Sum m, n, d, s Label4.Caption
2012-05-08 21:02:56
327
原创 摄氏度与华氏度之间的转换
代码如下: Option Explicit Private Function TransTh(sngT As Single, blnCtoF As Boolean) As String If blnCtoF Then TransTh = Format(sngT * 9 / 5 + 32, "0.#") Else TransTh = Format((
2012-05-08 21:02:01
775
原创 随机生成10个数并选出最大值
代码如下: Private Function max(a() As Integer) As Integer Dim i As Integer Dim maxa As Integer For i = LBound(a) To UBound(a) If a(i) > maxa Then maxa = a(i) max = maxa End If Next i End Functio
2012-05-08 21:00:45
1106
原创 比较三个数的大小
代码如下: Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer Dim max As Integer a = Val(Text1.Text) b = Val(Text2.Text) c = Val(Text3.Text) If a > b Then max = a Else m
2012-05-08 20:59:37
477
原创 比较两个数的大小
代码如下: Private Sub Command1_Click() Dim a As Integer, b As Integer a = Val(Text1.Text) b = Val(Text2.Text) If a > b Then Label3.Caption = a Else Label3.Caption = b End If End Sub 总结:学会了
2012-05-08 20:58:21
434
原创 纳税金额计算
代码如下: Private Sub Command1_Click() Dim n As Single, w As Single Dim s As Single, m As Single n = Val(Text1.Text) w = n - 500 Select Case w Case Is s = 0.05 Case Iw
2012-05-08 20:56:55
417
原创 怎样设计出能算出你出生时是星期几
代码如下: Private Sub Command1_Click() Dim Year As Integer Dim Month As Integer Dim Day As Integer Dim Birthday As Date Dim N As Integer Year = Int(Val(Text1.Text)) Month = Int(Val(Text2.Text)) D
2012-05-08 20:55:15
565
原创 生成随机图形
代码如下: Private Sub Command1_Click() Timer1.Enabled = True Timer1.Interval = 100 End Sub Private Sub Command2_Click() Form1.Cls End Sub Private Sub Command3_Click() Timer1 = False End Sub P
2012-05-08 20:52:48
672
原创 金箍棒变长
编程代码如下: Dim Step As Integer Private Sub Command1_Click() Timer1.Enabled = False Step = Step + 150 Line (1000, 1000)-(30 + Step, 1000), QBColor(Int(Rnd * 15)) End Sub Private Sub Timer1
2012-05-08 20:51:27
450
原创 vb中动画程序设计
学习这个还挺有意思的! 编写程序代码如下: Public TopBottom, LeftRight As String Private Sub Form_Click() If Timer1.Enabled = False Then Timer1.Enabled = True Else Timer1.Enabled = False
2012-05-08 20:46:26
657
原创 浮点数标准(单精度和双精度)
1985年IEEE(Institute of Electrical and Electronics Engineers)提出了IEEE754标准。该标准规定基数为2,阶码E用移码表示,尾数M用原码表示,根据二进制的规格化方法,最高数字位总是1,该标准将这个1缺省存储,使得尾数表示范围比实际存储的多一位。 iEEE754三种浮点数的格式参数
2012-03-27 22:34:08
2961
原创 第一次编程序求最大公约数2.15
虽然过程很难,但是通过努力自己成功了,心里很happy。体会到了编程的乐趣,以后继续努力学好VB。 过程如下: Private Sub Command1_Click() Dim M As Integer Dim N As Integer M = Int(Val(Text1.Text)) N = Int(Val(Text2.Text)) Dim Temparyvalue As Int
2012-03-27 22:25:46
324
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人