Private Sub cmdPOJ_Click()
Dim n As Integer, m As Integer, p As Integer, q As Integer, t As Integer, z As Integer, k As Integer, w As Integer, y As Integer, o As Integer, r As Integer, j As Integer, h As Integer, v As Integer, c As Integer
n = Val(InputBox("请输入应找零钱"))
m = n - 50
p = n - 70
q = n - 90
t = n - 95
z = n - 80
k = n - 85
w = n - 75
y = n - 65
o = n - 55
r = n - 45
j = n - 35
h = n - 25
v = n - 15
c = n - 5
If n / 50 > 1 Then
Print "50:1"
If m / 20 = 2 Then
Print "20:2"
ElseIf m / 20 > 2 Then
Print "20:2"
If q / 5 > 1 Then
Print "5:1"
Print "1:"; t
ElseIf q / 5 < 1 Then
Print "1:"; q
End If
ElseIf m / 20 = 1 Then
Print "20:1"
ElseIf m / 20 > 1 Then
Print "20:1"
If p / 10 = 1 Then
Print "10:1"
ElseIf p / 10 > 1 Then
Print "10:1"
If z / 5 = 1 Then
Print "5:1"
ElseIf z / 5 > 1 Then
Print "5:1"
Print "1:"; k
Else
Print "1:"; z
End If
ElseIf p / 5 = 1 Then
Print "5:1"
ElseIf p / 5 > 1 Then
Print "5:1"
Print "1:"; w
Else
Print "1:"; n - 70
End If
ElseIf m / 10 = 1 Then
Print "10:1"
ElseIf m / 10 > 1 Then
Print "10:1"
If (n - 60) / 5 = 1 Then
Print "5:1"
ElseIf (n - 60) / 5 > 1 Then
Print "5:1"
Print "1:"; y
Else
Print "1:"; n - 60
End If
ElseIf m / 5 = 1 Then
Print "5:1"
ElseIf m / 5 > 1 Then
Print "5:1"
Print "1:"; o
Else
Print "1:"; n - 50
End If
ElseIf n / 50 = 1 Then
Print "50:1"
ElseIf n / 20 = 2 Then
Print "20:2"
ElseIf n / 20 > 2 Then
Print "20:2"
If (n - 40) / 5 = 1 Then
Print "5:1"
ElseIf (n - 40) / 5 > 1 Then
Print "5:1"
Print "1:"; r
Else
Print "1:"; n - 40
End If
ElseIf n / 20 = 1 Then
Print "20:1"
ElseIf n / 20 > 1 Then
Print "20:1"
If (n - 20) / 10 = 1 Then
Print "10:1"
ElseIf (n - 20) / 10 > 1 Then
Print "10:1"
If (n - 30) / 5 = 1 Then
Print "5:1"
ElseIf (n - 30) / 5 > 1 Then
Print "5:1"
Print "1:"; j
Else
Print "1:"; n - 30
End If
Else
If (n - 20) / 5 = 1 Then
Print "5:1"
ElseIf (n - 20) / 5 > 1 Then
Print "5:1"
Print "1:"; h
Else
Print "1:"; n - 20
End If
End If
ElseIf n / 10 = 1 Then
Print "10:1"
ElseIf n / 10 > 1 Then
Print "10:1"
If (n - 10) / 5 = 1 Then
Print "5:1"
ElseIf (n - 10) / 5 > 1 Then
Print "5:1"
Print "1:"; v
Else
Print "1;"; n - 10
End If
ElseIf n / 5 = 1 Then
Print "5:1"
ElseIf n / 5 > 1 Then
Print "5:1"
Print "1:"; c
Else
Print n
End If
End Sub
Function isPrime(n As Integer) As Boolean
Dim i As Integer, m As Integer
For i = 2 To n
isPrime = True
For m = 2 To i - 1
If n Mod m = 0 Then
isPrime = False
End If
Next m
Next i
If isPrime = True Then
Print n;
End If
End Function
Private Sub cmdPOJ_Click()
Dim a As Integer, j As Integer
a = Val(InputBox("请输入一个数"))
For j = 1 To a
s = isPrime(j)
Next j
End Sub
Private Sub Form_Load()
End Sub
Function add(m As Integer, n As Integer)
Dim t As Integer, i As Integer
t = n - m
If t <= 4 Then
Print "0.5"
ElseIf t >= 31 Then
Print 5
End If
For i = 1 To 9
If t <= (4 + 3 * i) And t > (4 + 3 * (i - 1)) Then
Print 0.5 + 0.5 * i
End If
Next i
End Function
Private Sub cmdPOJ_Click()
Dim a As Integer, b As Integer, s As Double
a = Val(InputBox("请输入上客站编码"))
b = Val(InputBox("请输入下客站编码"))
s = add(a, b)
End Sub
Private Sub Form_Load()
End Sub
Function search(n As Long) As Boolean
Dim i As Integer
For i = 1 To n
If i Mod 5 = 0 And i Mod 7 = 0 Then
search = True
Else
search = False
End If
If search = True Then
Print i;
End If
Next i
End Function
Private Sub cmdPOJ_Click()
Dim a As Long
a = Val(InputBox("请输入N"))
s = search(a)
End Sub
Private Sub Form_Load()
End Sub
Function scoresum(a As Integer, b As Integer, c As Integer)
Dim s As Integer
s = a + b + c
Print s
End Function
Private Sub cmdPOJ_Click()
Dim m As Integer, n As Integer, p As Integer
m = Val(InputBox("请输入成绩1"))
n = Val(InputBox("请输入成绩2"))
p = Val(InputBox("请输入成绩3"))
t = scoresum(m, n, p)
End Sub
Private Sub Form_Load()
End Sub