VB编程找出所有能被9整除且至少有一位是2的三位正整数,按分区格式输出,每行输出7个
1个回答
展开全部
Private Sub Form_Load()
For i = 100 To 999
If i Mod 9 = 0 Then
If InStr(CStr(i), "2") <> 0 Then
If t = 7 Then
temp = temp & vbCrLf
t = 0
End If
temp = temp & CStr(i) & Chr(32)
t = t + 1
End If
End If
Next
Debug.Print temp
End Sub
For i = 100 To 999
If i Mod 9 = 0 Then
If InStr(CStr(i), "2") <> 0 Then
If t = 7 Then
temp = temp & vbCrLf
t = 0
End If
temp = temp & CStr(i) & Chr(32)
t = t + 1
End If
End If
Next
Debug.Print temp
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询