自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 随机生成10个整数

Dim a(1 To 10) As IntegerPrivate Sub Command1_Click() Form_LoadEnd Sub Private Sub Form_Load()  Dimp As String  'p用来显示随机生成的10个数 Randomize     p = ""  Fori = 1 To 10 '生成10个随机整数

2012-06-02 14:07:50 2571

原创 随机生成十个不重复的整数

第一篇:Private Sub Form_Load()Me.FontSize = 18Dim a(100) As Integer, b(100) As IntegerDim i As Integer, j As Integer, k AsIntegerForm1.AutoRedraw = TrueRandomizeFor i = 1 To 100a(i) = i

2012-06-02 14:06:54 1234

原创 判断整除并求和

Private Sub Command1_Click()Dim m As Integer, n As Integer, d AsIntegerDim s As Long '保存结果m = Val(Text1.Text)n = Val(Text2.Text)d = Val(Text3.Text)s = 0sum m, n, d, sLabel4.Caption = m

2012-06-02 14:05:24 360

原创 10个数的比较

Private Sub Command1_Click()Dim a As IntegerDim b As IntegerDim c As IntegerDim d As IntegerDim e As IntegerDim f As IntegerDim g As IntegerDim h As IntegerDim i As IntegerDim j As

2012-06-02 14:04:30 330

原创 温标转换

Option ExplicitPrivate Sub Command1_Click() '摄氏→华氏If Trim(Text1.Text) = "" Then Text1.Text = "0"'调用自定义函数Label3.Caption = transth(Val(Text1.Text), True)Label4.Caption = "摄氏度"Label5.Caption

2012-05-07 19:27:00 503

原创 求100以内的素数的和

Private Sub Command1_Click()   Dim s As Integer, n As Integer  s = 0: n = 1    Do While n     If IsPrimer(n)       s = s + n   End If   n = n + 1   Loop

2012-04-22 12:55:22 534

原创 判断一个数是否是素数

Private Function IsPrimer(n As Integer) As Integer    Dim i As Integer      For i = 2 To n - 1      If n Mod i = 0 Then       Exit For      End If   Next i      I

2012-04-22 12:54:33 280

原创 计算你的出生日期是星期几

Private Sub Command1_Click()Dim Year As IntegerDim Month As IntegerDim Day As IntegerDim dayofweek As ByteDim Birthday As DateYear = Int(Val(Text1.Text))Month = Int(Val(Text2.Text))Day

2012-04-22 12:52:17 721

原创 能同时被17和37整除的数

Private Sub Command1_Click()  Dim index As Integer  For index = 1000 To 2000 Step 1  If Is17and37ZhengChu(index) = True Then  Print Str(index)   End If   Next ind

2012-04-22 12:50:12 673

原创 几位数乘法的结构

Option Base 1 Private 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() A

2012-04-09 18:38:32 329

原创 实现能动的图形

Private Sub Form_Load()Timer1.Interval = 70End SubPrivate Sub Timer1_Timer()Timer1.Enabled = FalseIf Picture1.Left + Picture1.Width  Then                  Picture1.Left

2012-04-09 18:34:53 216

原创 随机图形

Private Sub Form_Load()Command1.Caption = "随机画圆"Command2.Caption = "随机文字"Command3.Caption = "立体图形"Command4.Caption = "随机图像"Command5.Caption = "退出"Form1.ScaleMode = 1Pictu

2012-04-09 18:31:54 341

原创 单精度和双精度

浮点数(float)又称作浮点数,是属于有理数中某特定子集的数的数字表示,在计算机中用以近似表示任意某个实数。具体来说,这个实数由一个整数或定点数(即尾数)乘以某个基数(计算机中通常是2)的整数次幂得到,这种表示方法类似于基数为10的科学记数法。浮点计算是指浮点数参与的运算,这种运算通常伴随着因为无法精确表示而进行的近似或舍入。一个浮点数a由两个数m和e来表示:a = m × be。在任意

2012-04-09 18:30:37 2261

原创 分析它是不是素数

Private Sub Command1_Click() Dim M As Integer Dim N As Integer Dim flag As Boolean M = Int(Val(Text1.Text)) N = M - 1 flag = False '为true时表示M可被比它小的整数整除' While N >= 2

2012-04-09 18:20:06 222

原创 制作秒表

Private Sub Command1_Click()Timer1.Enabled = TrueEnd Sub Private Sub Timer1_Timer()Label1.Caption = TimeEnd Sub   注:如果Label1.Caption=Now,则会出现年月日

2012-04-09 18:19:15 377

原创 计算两数之间的最大公约数

Option ExplicitPrivate Sub Command1_Click()  Dim M As Integer  Dim N As Integer  M=Int(Val(Text1.Text))  N=Int(Val(Text2.Text))  Dim TemporyValue As Integer  If M=N Then

2012-04-09 18:17:28 328

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除