输出[100,9999]区间的所有回文数,每行输出10项,分多行输出。要求使用Function过程进行回文数判断。

Public Function hws(a As Integer)
If StrReverse(a) = a Then
hws = 1
Else: hws = 0
End If
End Function

Private Sub form_Click()
Dim i%
For i = 100 To 9999
If hws(i) = 1 Then
Print i;
n = n + 1
If n Mod 10 = 0 Then Print
End If
Next i
End Sub

猜你喜欢

转载自www.cnblogs.com/xbnl-bk-zm-2018/p/10941395.html