For...Next...循环的问题
发布网友
发布时间:2023-07-08 23:12
我来回答
共3个回答
热心网友
时间:2023-10-29 00:37
修改了一下。
Private Sub Form_Click() '窗体的鼠标单击事件
Dim a As Integer'定义a,b为整形数字
Dim b As Integer
For a = 1 To 10'循环10次,就是打印10行
For b = 1 To a'循环每一行打印的星号个数,第一行一个,第二行就是2个
Print "*";'打印星号
Next
Print'打印完了一行后,打印空字符,这里相当于换行。
Next
End Sub
热心网友
时间:2023-10-29 00:37
Dim a As Integer
Dim b As Integer
dim s as string
For a = 1 To 10
s=""
For b = 1 To a
Print s=s&"*"
Next b
Print s
Next a
热心网友
时间:2023-10-29 00:38
Private Sub Form_Click()
Dim a As Integer
Dim b As Integer
For a = 1 To 5
For b = 1 To a
print *
next b
print
next a
end sub
我给的是VB的,你试试对不对?是VB吧?我都考完很久了,快忘光了,fortran可以么?