应该是这样,原来的程序中没有输出语句,所以不会有输出的。
Private Sub Command1_Click()
Dim sum As Long, n As Integer
sum = 0
For n = 100 To 999
If duicheng(n) Then sum = sum + n
Next n
Print sum
End Sub
Public Function duicheng(ByVal i%) As Boolean
a = i Mod 10
c = i \ 100
If a = c Then
duicheng = True
Else
duicheng = False
End If
End Function
你应该问的是结果显示在哪。