VB 求10000-99999之间的全部回文式素数我写的程序如下,始终显示ByRef的参数类型错误,Private Function fact(n%) As BooleanDim s%fact = TrueFor s = 2 To n - 1If n Mod i = 0 Thenfact = FalseExit ForEnd IfNext iEnd FunctionPrivate
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/08 23:38:37
![VB 求10000-99999之间的全部回文式素数我写的程序如下,始终显示ByRef的参数类型错误,Private Function fact(n%) As BooleanDim s%fact = TrueFor s = 2 To n - 1If n Mod i = 0 Thenfact = FalseExit ForEnd IfNext iEnd FunctionPrivate](/uploads/image/z/12558887-71-7.jpg?t=VB+%E6%B1%8210000-99999%E4%B9%8B%E9%97%B4%E7%9A%84%E5%85%A8%E9%83%A8%E5%9B%9E%E6%96%87%E5%BC%8F%E7%B4%A0%E6%95%B0%E6%88%91%E5%86%99%E7%9A%84%E7%A8%8B%E5%BA%8F%E5%A6%82%E4%B8%8B%2C%E5%A7%8B%E7%BB%88%E6%98%BE%E7%A4%BAByRef%E7%9A%84%E5%8F%82%E6%95%B0%E7%B1%BB%E5%9E%8B%E9%94%99%E8%AF%AF%2CPrivate+Function+fact%28n%25%29+As+BooleanDim+s%25fact+%3D+TrueFor+s+%3D+2+To+n+-+1If+n+Mod+i+%3D+0+Thenfact+%3D+FalseExit+ForEnd+IfNext+iEnd+FunctionPrivate)
VB 求10000-99999之间的全部回文式素数我写的程序如下,始终显示ByRef的参数类型错误,Private Function fact(n%) As BooleanDim s%fact = TrueFor s = 2 To n - 1If n Mod i = 0 Thenfact = FalseExit ForEnd IfNext iEnd FunctionPrivate
VB 求10000-99999之间的全部回文式素数
我写的程序如下,始终显示ByRef的参数类型错误,
Private Function fact(n%) As Boolean
Dim s%
fact = True
For s = 2 To n - 1
If n Mod i = 0 Then
fact = False
Exit For
End If
Next i
End Function
Private Function hws(n%) As Boolean
Dim data%,ten%,thu%,wan%
data = n Mod 10
ten = (n \ 10) Mod 10
thu = (n \ 1000) Mod 10
wan = n \ 10000
If data = wan And ten = thu Then
hws = True
End If
End Function
Private Sub Command1_Click()
Dim ,k%
For i = 10000 To 99999
If fact(i) = True And hws(i) = True Then
k = k + 1
Print i;
If k Mod 7 = 0 Then
Print
End If
End If
Next i
End Sub
VB 求10000-99999之间的全部回文式素数我写的程序如下,始终显示ByRef的参数类型错误,Private Function fact(n%) As BooleanDim s%fact = TrueFor s = 2 To n - 1If n Mod i = 0 Thenfact = FalseExit ForEnd IfNext iEnd FunctionPrivate
integer % 短整型
long & 长整型
single !单精度浮点型
double # 双精度浮点型
currency @ 货币型
string $ 字符型
你的程序
Private Sub Command1_Click()
Dim i!,k%
If fact(i) = True And hws(i) = True Then
和这个地方
Private Function fact(n%) As Boolean
的传值有问题,不是同一种数据类型