Function hw(m As Long) As Boolean Dim a As Integer,b As Integer,c As Integer,d As Integer a = LeFunction hw(m As Long) As BooleanDim a As Integer,b As Integer,c As Integer,d As Integera = Left(m,1):b = Mid(m,2,1)c = _____________________d = _________
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 20:29:55
Function hw(m As Long) As Boolean Dim a As Integer,b As Integer,c As Integer,d As Integer a = LeFunction hw(m As Long) As BooleanDim a As Integer,b As Integer,c As Integer,d As Integera = Left(m,1):b = Mid(m,2,1)c = _____________________d = _________
Function hw(m As Long) As Boolean Dim a As Integer,b As Integer,c As Integer,d As Integer a = Le
Function hw(m As Long) As Boolean
Dim a As Integer,b As Integer,c As Integer,d As Integer
a = Left(m,1):b = Mid(m,2,1)
c = _____________________
d = _____________________
hw = IIf(a = d And b = c,True,False)
End Function
Function ss(m As Long) As Boolean
Dim k As Long,i As Long,f As Boolean
f=True
k = Sqr(m)
For i = 2 To k
If _____________________ Then
f = False
Exit For
End If
Next i
________________
End Function
Private Sub Command1_Click()
Dim m As Long,n As Integer
For m = 10000 To 99999
If _____________________________ Then
Print Tab((n Mod 10) * 8 + 1); m;
n = n + 1
End If
Next m
End Sub
Mid(m,4,1) Right(m,1) 注意:只要能取出第四、五位即可得分
m mod i=0(只要能判断整除即可)
ss=f ss(m) hw(m)(只写ss及hw不得分,如果写了True但写错了扣1分)
Function hw(m As Long) As Boolean Dim a As Integer,b As Integer,c As Integer,d As Integer a = LeFunction hw(m As Long) As BooleanDim a As Integer,b As Integer,c As Integer,d As Integera = Left(m,1):b = Mid(m,2,1)c = _____________________d = _________
Function hw(m As Long) As Boolean
Dim a As Integer, b As Integer, c As Integer, d As Integer
a = Left(m, 1): b = Mid(m, 2, 1)
c = Mid(m, 4, 1)
d = Right(m, 1)
hw = IIf(a = d And b = c, True, False)
End Function
Function ss(m As Long) As Boolean
Dim k As Long, i As Long, f As Boolean
f = True
k = Sqr(m)
For i = 2 To k
If m Mod i = 0 Then
f = False
Exit For
End If
Next i
ss = f
End Function
Private Sub Command1_Click()
Dim m As Long, n As Integer
For m = 10000 To 99999
If ss(m) And hw(m) Then
Print Tab((n Mod 10) * 8 + 1); m;
n = n + 1
End If
Next m
End Sub