n= n+1??
vb吧
全部回复
仅看楼主
level 1
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNumeric(Text1.Text) And Val(Text1.Text) <> 0 Then
a(n) = Val(Text1.Text)
Picture1.Print a(n)
n = n + 1
Else: MsgBox ("输入不正确,请重新输入!")
End If
Text1.Text = ""
Text1.SetFocus
If n > 99 Then
Text1.Enabled = False
Else: Text1.SetFocus
End If
End If
Private Sub Command2_Click()
Dim sum As Single, i As Integer
sum = 0
i = 0
Do While a(i) <> 0
    sum = sum + a(i)
    i = i + 1
Loop
Picture1.Print "总和="; sum
请问这个n= n+1 ,i = i+1 是什么意思...这种类型的总是搞不懂,谢谢
2009年04月18日 01点04分 1
level 0
n = n + 1
就是n先+1,然后再把结果赋给n
2009年04月18日 01点04分 2
level 0
理解为自身+1
2009年04月18日 01点04分 3
level 0
dim n as long
n = 3
n = n + 1
msgbox n
2009年04月18日 01点04分 4
level 1
额可是为什么要加呢
虽然我知道不加的话后面的sum ,a(n)都会变为0
搞不懂..
2009年04月18日 02点04分 5
level 0
加的话就可以遍历数组的所有元素
2009年04月18日 02点04分 6
level 1
恩,谢谢大家
2009年04月18日 02点04分 7
level 5
就是n++
2009年04月19日 00点04分 8
1