自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

薄荷味徐福记

或许是不知梦的缘故,流离之人追逐幻影。

  • 博客(13)
  • 收藏
  • 关注

原创 n*1并输出于文件中

Private Sub Command1_Click()ClsDim i As LongDim L As LongDim r() As ByteDim a() As ByteDim b As StringDim c As ByteL = Len(Me.Text1.Text)ReDim a(L)For i = 1 To L    b = Mid(Me.Te

2016-04-21 17:07:58 218

原创 十的阶乘

Private Sub Command1_Click()ClsPrint 阶乘(10)End SubPrivate Function 阶乘(n As Integer) As LongIf n = 1 Then阶乘 = 1Else阶乘 = n * 阶乘(n - 1)End IfEnd Function

2016-04-14 17:35:22 360

原创 余数和商

Option Base 1Private Sub Command1_Click()Dim yushu As ByteDim shang As ByteDim n2() As ByteDim n1() As ByteDim n1len As LongDim n2len As LongDim i As LongDim tempresult As Byten1le

2016-04-14 17:27:02 536

原创 用计时器计算1至100的和

Option ExplicitDim i As IntegerDim sum As IntegerPrivate Sub Command1_Click()ClsFont.Size = 70End SubPrivate Sub Timer1_Timer()sum = sum + ii = i + 1If i > 100 ThenMe.Timer1.Enab

2016-04-14 16:36:10 288

原创 余数和商

Private Sub Command1_Click()Dim 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.Text))tempresult = n1

2016-04-14 16:31:53 375

原创 十个随机数相加

1.Option ExplicitPrivate Sub Command1_Click()ClsDim i As Integer, Sum As IntegerDim a(10) As IntegerRandomizeFor i = 1 To 10a(i) = Int(Rnd * 1000) + 1Sum = Sum + a(i)Next iPrint

2016-04-07 16:27:54 250

原创 c语言与vb

这两种语言都属于编程语言,但对我来说使用起来却是两种完全不同的感受,使用C语言就感觉我可以熟练的驾驭它,但在vb却是完全不同的体验。        在C语言中我可以自己编译简单的程序,但是在vb我却只能机械的输入现成的语句。仔细想想不难发现在C语言中我理解其中的每个语句,而在VB中我完全不懂每句话存在的意义,在我看来C语言中语句拥有更强的逻辑性以及更短的语句所带来更简单的理解性,这也可能是C语

2016-03-31 17:16:43 2757

原创 n个随机数排列

Option Base 1Private Sub Command1_Click()    Cls    Dim x As Integer    x = Int(Val(Me.Text1.Text))    Dim n As Integer    Dim A() As Integer    ReDim A(x)        n = LBound(A)

2016-03-31 17:05:22 381

原创 15个随机数排序

Private Sub cmdSort_Click()   Dim A(14) As Integer   Dim I, J As Integer   Dim Temp As Integer   Form1.Cls   Randomize   For I = 0 To 14   A(I) = Int(Rnd * 1000)   Next I   For I = 0

2016-03-24 17:44:45 526

原创 随机数由小到大排序

Private Sub Command1_Click()ClsMe.Font.Size = 50Dim b As Integer, c As IntegerDim d As Integerc = Int(Rnd() * 1000)b = Int(Rnd() * 1000)Print "b=" & bPrint "c=" & cd = cc = bb

2016-03-24 17:42:36 531

原创 两个随机数排序

Private Sub Command1_Click()    Cls    Me.Font.Size = 50    Dim a As Integer    Dim b As Integer    Dim swap As Integer        a = Int(Rnd * 1000)    b = Int(Rnd * 1000)    If a

2016-03-24 17:41:03 279

原创 交换

方法一:Private Sub Command3_Click()Dim a As Stringa = Text1.TextText1.Text = Text2.TextText2.Text = aEnd SubPrivate Sub Text1_Change()Text1.BackColor = vbBlackText1.ForeColor = vb

2016-03-17 17:28:21 174

原创 变量代换

Private Sub Command1_Click()ClsDim b As Integer, c As IntegerDim d As Integerc = Int(Rnd() * 1000)b = Int(Rnd() * 1000)Print "b=" & bPrint "c=" & cd = cc = bb = d              

2016-03-17 17:06:47 600

空空如也

空空如也

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

TA关注的人

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