vb学习笔记

 申明变量 

 Dim a AS Integer/double/Single

 

循环语句

For J=1 To 100 Step 1

Next J

 

选择语句

 

If 条件  Then

语句组1

else

……

End If

 

and 与
or 或
xor 抑或
not 非

&符号是作字符串连接用的,比如"abc" & "123"的结果为"abc123" 

 

vb上的递归

Public Function fuck_xiang(a As Integer) As Integer


If a = 1 Or a = 2 Then

fuck_xiang = 1


Else: fuck_xiang = fuck_xiang(a - 1) + fuck_xiang(a - 2)

End If



End Function


Private Sub Command1_Click()

Dim i As Integer


For i = 1 To 10 Step 1

Print fuck_xiang(i)

Next i



End Sub

 

posted @ 2019-02-27 17:38  前排吃瓜  阅读(367)  评论(2编辑  收藏  举报