第一次听说对调数,查了下知道是怎么回事,只需要判断对调数大于10即可(因为个位数为0的对调数必定小于10),整个程序的代码如下:
Dim i As Integer, j As Integer, m As Integer, n As Integer
For i = 11 To 29
For j = 11 To 29
If i <> j Then
m = i \ 10 + (i Mod 10) * 10
n = j \ 10 + (j Mod 10) * 10 '产生两个对调数
If m > 10 And n > 10 And i + j = m + n Then Print i; "+"; j; "="; m; "+"; n
End If
Next
Next