- 博客(14)
- 收藏
- 关注
原创 判断整除并求和
代码:Private Sub Command1_Click()Dim m As Integer, n As Integer, d As IntegerDim s As Longm = Val(Text1.Text)n = Val(Text2.Text)d = Val(Text3.Text)s = 0Sum m, n, d, sLabel4.Caption = m
2012-05-22 20:40:07 303
原创 判断并输出1000到2000之间能同被17和37整除的的数
代码:Private Sub Command1_Click() Dim A As IntegerA = val(Text1.Text)If A Mod 17 = 0 Then If A Mod 37 = 0 Then Label3.Caption = "此数可以同时被17和37整除" Else L
2012-05-22 20:33:24 1566
原创 用vb程序输出10个随机数
代码:Private Sub Command1_Click()Dim i As Integer, t As IntegerDim k As IntegerDim a(10) As IntegerDim mystr As StringDim youstr As String a(1) = Int(Rnd * 100 + 1) mystr = "要"
2012-05-22 20:26:40 2682
原创 判断10个数大小
代码:Private Function max(a() As Integer) As IntegerDim i As IntegerDim maxa As IntegerFor i = LBound(a) To UBound(a)If a(i) > maxa Thenmaxa = a(i)max = maxaEnd IfNext i
2012-05-22 20:21:02 612
原创 比较三个数大小
代码:Private Sub Command1_Click()Dim a As Integer, b As Integer, c As IntegerDim max As Integera = Val(Text1.Text)b = Val(Text2.Text)c = Val(Text3.Text)If a > b Then max = aE
2012-05-22 20:15:30 285
原创 比较两个数大小
代码:Private Sub Command1_Click()Dim a As Integer, b As Integera = Val(Text1.Text)b = Val(Text2.Text)If a > b ThenLabel3.Caption = aElseLabel3.Caption = bEnd IfEnd Sub 心得
2012-05-22 20:12:14 697
原创 设计vb程序计算税率
代码:Private Sub Command1_Click()Dim n As Single, w As SingleDim s As Single, m As Singlen = Val(Text1.Text)w = n - 500Select Case w Case Is s = 0.05 Case Iw
2012-05-22 20:07:32 784
原创 计算出生是星期几
代码:Private Sub Command1_Click()Dim Year As IntegerDim Month As IntegerDim Day As IntegerDim Birthday As DateDim N As IntegerYear = Int(Val(Text1.Text))Month = Int(Val(Text2.Text))D
2012-05-22 19:57:51 476
原创 两个多位数相乘
代码:Option Base 1Private Sub Command1_Click() Dim M As String Dim N As String M = Trim(Text1.Text) N = Trim(Text2.Text) Dim Number1() As Byte Dim Number2()
2012-05-22 19:50:35 393
原创 用vb程序设计输出100以内素数和
代码:Private Function Judge()Dim b As Integerb = b / 1 * bEnd FunctionPrivate Sub Command1_Click() Dim a As Integer, b As Integer Show a = 0: b = 1 If Judge(b Do a =
2012-05-22 19:38:08 9338
原创 用vb程序设计动画
代码:Public TopBottom, LeftRight As StringPrivate Sub Form_Click() If Timer1.Enabled = False Then Timer1.Enabled = True Else Timer1.Enabled = False End IfEnd S
2012-05-22 19:22:33 918
原创 VB程序设计实验报告
VB程序设计实验报告一:试验目的:1 利用vb程序设计语言制作随机图形2 利用vb程序设计语言制作动画二:实验内容:1先进行界面分布和相应的属性设置2编写代码如下:1,Private Sub Command1_Click()Timer1.Enabled = TrueTimer1.Interval = 100End SubPrivate Sub Comma
2012-03-28 07:07:23 2426
原创 单精度浮点数与双精度浮点数
(1) 单精度浮点数(Single) 用来表示带有小数部分的实数,一般用于科学计算。 占用4个字节(32位)存储空间,包括符号位1位,阶码8位,尾数23位。其数值范围为3.4E-38~3.4E+38,单精度浮点数最多有7位十进制有效数字,单精度浮点数的指数用“E”或“e”表示。 单精度浮点数有多种表示形式:±n.n(小数形式) ±n E±m(指数形式) ±n.n E ±m
2012-03-28 07:04:56 2909
原创 学习VB的第一节课
Option ExplicitPrivate Sub Command1_Click()Dim M As IntegerDim N As IntegerM = Int(Val(Text1.Text))N = Int(Val(Text2.Text))Dim TemparyValue As IntegerIf M TemparyValue = MM = NN =
2012-03-28 07:03:26 525
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人