本帖最后由 Akon32 于 2010-06-09 20:01:36 编辑

解决方案 »

  1.   

    Dim a(), i, n, temp
    Public Function shuru()
    n = 1000
    ReDim a(n)
    For i = 0 To n
      temp = trim(InputBox("请输入成绩:"))
      if temp = "" then exit for
        
      a(i) = int(val(temp))     Print a(i)
    Next iEnd Function
      

  2.   

    上面的有点错误Dim a(), i, n, temp
    Public Function shuru()
    n = 1000
    ReDim a(n)For i = 0 To n - 1
      temp = trim(InputBox("请输入成绩:"))
      if temp = "" or int(val(temp)) < 0 then exit for  a(i) = int(val(temp))     Print a(i)
    Next iEnd Function
      

  3.   

    Dim a(), i, n
    Public Function shuru()
    n = 1000
    ReDim a(n)
    For i = 0 To n
      If InputBox("请输入成绩:") = "" Then Exit For
        
      
      If a(i)="" or a(i)<=0 Then Exit For 
      If Asc(a(i)<47) Or Asc(a(i)>58) Then Exit For
      a(i) = val(InputBox("请输入成绩:"))
      Print a(i)  Next i  End Function