VB试题,编写程序,找出能满足abcd=(ab+cd)^2形式的所有四位数abcd

2025-04-03 23:29:21
推荐回答(1个)
回答1:

Private Sub Form_Click()
Dim i As Integer
Dim aa, bb As Integer
For i = 1000 To 9999
aa = i Mod 100
bb = Int(i / 100)
If i = (aa + bb) * (aa + bb) Then
Print i
End If
Next
End Sub