Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FORM1
- ___________________________________________________________________________________________________
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim s1(5) As Module1.x, n As Integer
- vvod(s1, n)
- pech(s1, n, ListBox1)
- alph(s1, n)
- pech(s1, n, ListBox2)
- End Sub
- End Class
- ___________________________________________________________________________________________________
- MODULE
- ___________________________________________________________________________________________________
- Module Module1
- Public Structure x
- Public fam As String
- Public gr As String
- Public oc As String
- Public Sub vvodp()
- fam = InputBox("fam")
- gr = InputBox("gr")
- oc = InputBox("ocenki")
- End Sub
- Public Function stroka() As String
- stroka = LSet(fam, 10) + LSet(Str(gr), 4) + LSet(Str(oc), 4)
- End Function
- End Structure
- Public Sub alph(ByVal s() As x, ByVal n As Integer)
- Dim i As Integer, ots As Boolean, buf As x
- Do
- ots = True
- For i = 0 To n - 2
- If s(i).fam > s(i + 1).fam Then
- ots = False
- buf = s(i)
- s(i) = s(i + 1)
- s(i + 1) = buf
- End If
- Next
- Loop Until ots = True
- End Sub
- Public Sub vvod(ByRef s() As x, ByRef n As Integer)
- Dim i As Integer
- n = Val(InputBox("Kol-vo stud"))
- For i = 0 To n - 1
- s(i).vvodp()
- Next
- End Sub
- Public Sub pech(ByVal s() As x, ByVal n As Integer, ByRef lst1 As ListBox)
- Dim i As Integer
- For i = 0 To n - 1
- lst1.Items.Add(s(i).stroka)
- Next
- End Sub
- End Module
- ___________________________________________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement