自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 随意生成10个数并排序(冒泡排序法)

Private Sub Command1_Click()Me.Font.Size = 30Dim a(10) As IntegerDim i As IntegerDim t As IntegerDim p As StringFor i = 1 To 10   a(i) = 10 + Int(Rnd() * 100)   Print a(i);Next iPr

2016-05-07 17:55:57 3189

原创 随意生成10个数并排序(选择排序法)

Private Sub Command1_Click()Me.Font.Size = 30Dim a(10) As IntegerDim i As IntegerFor i = 1 To 10   a(i) = 10 + Int(Rnd() * 100)   Print a(i);Next iPrint Dim j As IntegerFor j = 1

2016-05-07 17:34:55 1391

原创 十进制变十六进制

Private Sub Command1_Click()Me.Font.Size = 30Dim a As IntegerDim b As IntegerDim s As StringDim yushu As Bytea = 1230b = 16While a   yushu = a Mod b   If yushu        s = yushu &

2016-05-07 17:10:57 294

转载 十进制转化为二进制和十六进制

Private Sub Command1_Click()Private Sub Form_Load()n = Val(InputBox("230"))m = nX = "": y = ""Do While n a = n Mod 2n = n \ 2X = a & XLoopMsgBox m & "换成二进制数是:" & XDo While Len(

2016-04-28 17:43:08 485

原创 0~255的二进制表示

Private Sub Command1_Click()Me.Font.Size = 30Print erjinzhi(230)End SubPrivate Function erjinzhi(m As Byte) AsStringDim n As Byten = mConst er As Byte = 2Dim returns As StringDim sha

2016-04-28 16:53:39 2472

原创 给定一个整数,求它的二进制表示

Private Sub Command1_Click()Me.Font.Size = 60Dim n As Byten = 23Const er As Byte = 2Dim shang As ByteDim yushu(1 To 5) As ByteDim i As Bytei = 5shang = n \ eryushu(i) = n Mod er 

2016-04-28 16:52:04 961

原创 多位数*一位数

Private Sub Command1_Click()ClsDim c As ByteDim a() As ByteDim b As StringDim changdu As Long, i As Longchangdu = Len(Text1.Text)ReDim a(changdu)For i = 1 To changdu    b = Mid(Me.

2016-04-21 17:13:55 264

原创 两位数*一位数

Option Base 1Private Sub Command1_Click()Me.Font.Size = 70Dim n1() As Byte, n1len As LongDim n2() As Byte, n2len As LongDim yushu As ByteDim i As LongDim shang As ByteDim tempresult As

2016-04-14 17:31:20 207

原创 一位数 * 一位数

Private Sub Command1_Click()Me.Font.Size = 70Dim n1 As ByteDim n2 As ByteDim yushu As ByteDim shang As ByteDim tempresult As Byten1 = Int(Val(Me.Text1.Text))n2 = Int(Val(Me.Text2.Tex

2016-04-14 16:53:26 207

原创 静态变量static

Option ExplicitDim i As IntegerDim sum As IntegerPrivate Sub Command1_Click()ClsFont.Size = 70Static i As Integeri = i + 1Print iEnd SubFunction f(x As Integer) As Long    Dim i

2016-04-14 16:28:51 228

原创 (9)

Dim sum As IntegerDim i As IntegerDim a As IntegerPrivate Sub Command1_Click()sum = 0For i = 1 To 10Randomize    a = Int(1000 * Rnd)    sum = sum + a      Next    MsgBox "10个随机数和为:

2016-04-07 17:40:42 186

原创 (8)

Private Sub Command1_Click()ClsFont.Size = 50Print f(100)End SubPrivate Function f(x As Integer) As Long    If x = 1 Then       f = x    Else       f = x + f(x - 1)    End If

2016-04-07 17:32:48 219

原创 (7)

i = 1DoRandomizea = Int(1000 * Rnd)sum = sum + ai = i + 1Loop Until i > 10MsgBox "10个随机数和为:" & sum

2016-04-07 17:25:17 167

原创 (6)

i = 1DoRandomizea = Int(1000 * Rnd)sum = sum + ai = i + 1Loop While i MsgBox "10个随机数和为:" & sum

2016-04-07 17:21:41 247

原创 (5)

Do Until i > 10Randomizea = Int(1000 * Rnd)sum = sum + aMsgBox "10个随机数和为:" & sumLoop

2016-04-07 17:18:20 217

原创 (4)

Do While i Randomizea = Int(1000 * Rnd)sum = sum + aMsgBox "10个随机数和为:" & sumLoop

2016-04-07 17:14:36 186

原创 (3)

Dim sum As IntegerDim i As IntegerDim a As IntegerPrivate Sub Command1_Click()sum = 0For i = 1 To 10Randomize    a = Int(1000 * Rnd)    sum = sum + a    MsgBox "10个随机数和为:" & sum   

2016-04-07 17:04:30 190

原创 生成10个数求他们的和(2)

Private Sub Command1_Click()ClsFont.Size = 30Dim n As IntegerDim s As IntegerDim a(10) As Integern = 1While n a(n) = Int(Rnd * 1000)n = n + 1Wendn = 1While n Print a(n)n

2016-04-07 16:56:12 167

原创 生成10个数并求它们的和(1)

Private Sub Command1_Click()ClsFont.Size = 70Dim i As IntegerDim a(10) As IntegerDim sum As IntegerRandomizeFor i = 1 To 10a(i) = Int(Rnd * 1000) + 1sum = sum + a(i)Next iPrint

2016-04-07 16:24:31 514

原创 。。。。。。

Option Base 1Private Sub Command1_Click()ClsFont.size = 30Dim n As IntegerDim size As Integersize = Int(Val(Me.Text1.Text))Dim sierdun(15) As Integern = LBound(sierdun)While n

2016-03-31 17:48:38 170

原创 比较3个数的大小

Private Sub Command1_Click()ClsMe.Font.Size = 24Dim a As IntegerDim b As IntegerDim c As Integera = Int(Rnd * 1000)b = Int(Rnd * 1000)c = Int(Rnd * 1000)If a Call swap(a, b)E

2016-03-31 17:33:10 830

原创 排列15个数的大小

Private Sub Command1_Click()ClsMe.Font.Size = 24Dim a As IntegerDim b As IntegerDim c As IntegerDim d As IntegerDim e As IntegerDim f As IntegerDim g As IntegerDim h As IntegerDi

2016-03-31 17:32:02 202

原创 棒棒哒

Private Sub Command1_Click()ClsFont.Size = 30Dim n As IntegerDim sierdun(15) As Integern = 1While n     sierdun(n) = Int(Rnd * 1000)    n = n + 1    Wend    '开始排序    Dim swap As

2016-03-31 17:17:07 202

空空如也

空空如也

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

TA关注的人

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