VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = "Form1" ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 'Windows Default Begin VB.ListBox lstSOL Height = 2400 Left = 3720 Sorted = -1 'True TabIndex = 5 Top = 720 Width = 855 End Begin VB.TextBox Text3 Height = 2415 Left = 120 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 4 Top = 720 Width = 3495 End Begin VB.CommandButton Command1 Caption = "Command1" Height = 375 Left = 2280 TabIndex = 3 Top = 240 Width = 975 End Begin VB.TextBox Text2 Height = 285 Left = 1440 TabIndex = 2 Text = "13" Top = 240 Width = 735 End Begin VB.TextBox Text1 Height = 285 Left = 120 TabIndex = 0 Text = "1" Top = 240 Width = 735 End Begin VB.Label Label1 Caption = "mod" Height = 375 Left = 960 TabIndex = 1 Top = 240 Width = 975 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim xarr(10) As Long Private Sub Command1_Click() lstSOL.Clear Text3.Text = Empty Dim i As Integer, xin As Long For i = 0 To UBound(xarr) xin = (xarr(i)) + ((xarr(i) Mod 100) + (xarr(i) Mod 10)) + (xarr(i) Mod 25) Text3.Text = Text3.Text & vbNewLine & xin & " mod " & Text2.Text & " = " & xin Mod Text2.Text lstSOL.AddItem xin Mod 13 Next i End Sub Private Sub Form_Load() 'xarr = Split("10, 100, 32, 45, 58, 126, 3, 29, 200, 400, 0", ", ") xarr(0) = 10 xarr(1) = 100 xarr(2) = 32 xarr(3) = 45 xarr(4) = 58 xarr(5) = 126 xarr(6) = 3 xarr(7) = 29 xarr(8) = 200 xarr(9) = 400 xarr(10) = 0 End Sub