文档介绍:Dim s(1 To 100) As Integer
Private mand1_Click()
Dim i As Integer
Randomize
For i = 1 To 100
s(i) = Int(Rnd * (999 - 100 + 1) + 100)
s(i)
Next i
End Sub
Private mand2_Click()
Dim i As Integer
For i = 1 To 100
If s(i) > 800 Then s( i )
Next i
End Sub
Private Sub Form_Click()
Dim n As Integer, x As Double, i As Integer
Dim s As Double
n = Val()
x = Val()
s = 0
For i = 1 To n
s = s + Cos(i * x) / (i * x)
Next i
= Round(s, 4)
End Sub
Option Base 1
Private Sub Form_Click()
Dim n As Integer, i As Integer, j As Integer
Dim a() As Integer
n = Val(InputBox("n=", "输入"))
ReDim a(n)
Randomize
For i = 1 To n
a(i) = Int(Rnd * 90 + 10)
Next i
For i = 1 To n - 1
For j = i + 1 To n
If a(i) < a(j) Then
x = a(i)
a(i) = a(j)
a(j) = x
End If
Next j
Next i
= Sqr(a(1)) + Sqr(a(2)) + Sqr(a(3))
End Sub
Dim x As Double, y As Double, z As Double
Private mand1_Click()
Dim a As Double
If x > y Then
a = x
x = y
y = a
End If
If x > z Then
a = x
x = z
z = a
End If
If y > z Then
a = y
y = z
z = a
End If
x
y
z
End Sub
Private Sub Form_Click()
x = InputBox("x=?", "输入")
y = InputBox("y=?", "输入")
z = InputBox("z=?", "输入")
= x
= y
= z
End Sub
Private Sub Form_Click()
Dim n As Integer, i As Integer
Dim s As Long, g As Long
n = InputBox("n=?")
s = 0
g = 1
For i = 1 To n
g = g * i
s = s + (-1) ^ (i + 1) * g
Next i
Print "s="; s
End Sub
Private mand1_Click()
If InStr(, "x") = 0 Then
= False
= False
Else
= True
= True
End If
End Sub
Private mand2_Click()
Dim i As Integer
Dim s As Integer
For i = 1 To Len()
If p(Mid(, i, 1), "x") = 0 Then
s = s + 1
End If
Next i
Print Val(s)
End Sub
Private mand3_Click()
= InStr(