下列说法中正确的是( )
B .
C .
D .
Private Sub Command1_Click()
Dim sum As Double, x As Double
sum=0
n=0
For i=1 To 5
x=n/i
n=n+1
sum=sum+x
Next i
End Sub
该程序计算了一个表达式的值,这个表达式是( )
Private Sub Command1_Click()
Dim result As String, s As String, c As String, cmax as string
Dim i As Integer, j As Integer
s = Text1.Text
Text2.Text = ""
For i = 1 To Len(s)
If c >= "A" And c <= "Z" Or c >= "a" And c <= "z" Then
result =
End If
Next i
Text2.Text = result
j = 2
cmax = Mid(result, 1, 1)
Do While j <= Len(result)
If Mid(result, j, 1) > cmax Then cmax = Mid(result, j, 1)
Loop
Text3.Text = cmax
End Sub
Private Sub Command1_Click()
Dim i As Integer
Randomize
For i = 1 To 100
f(i) = False
Next i
n = Val(Text1.Text)
For i = 1 To n
t = Int(Rnd * 100 + 1)
Do While f(t) = True
Loop
f(t) = True
Next i
j = 0
For i = 1 To 100
If Then
j = j + 1
a(j) = i
List1.AddItem Str(i)
End If
Next i
End Sub
Private Sub Command2_Click()
Dim b(1 To 100) As Integer, k As Integer, c As Integer, max As Integer
Dim s As String
Dim j As Integer
n = Val(Text1.Text)
max = 0
For k = 1 To n
i = 1: j = n: c = 0
Do While i <= j
m = (i + j) \ 2: c = c + 1
If c > max Then max = c
If m = k Then b(m) = c: Exit Do
If m < k Then i = m + 1 Else j = m - 1
Loop
Next k
For i = 1 To max
s = ""
For j = 1 To n
If Then
s = s + Str(a(j))
Else
s = s + ""
End If
Next j
List2.AddItem s
Next i
End Sub