#芝麻开门#vb 过程填空判断一个三位数是否为对称数(如:343)的函数过程,求出所有三位对称数之和。

2025-05-14 05:51:26
推荐回答(2个)
回答1:

应该是这样,原来的程序中没有输出语句,所以不会有输出的。
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

回答2:

你应该问的是结果显示在哪。