Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Private Structure Personne
- Dim nomPersonne As String
- Dim occurence As Integer
- End Structure
- Sub Main()
- Dim myname As String
- Dim nom(99999) As Personne
- Dim cmp As Integer = 0
- Do
- ' Entree des noms
- myname = InputBox("Entrer un nom", "Comptage des noms")
- For cmp2 As Integer = 0 To cmp
- If nom(cmp2).nomPersonne = myname Then
- nom(cmp2).occurence += 1
- Else
- nom(cmp).nomPersonne = myname
- nom(cmp).occurence = 1
- cmp += 1
- End If
- Next
- Console.Write(nom(cmp) & " ")
- Loop Until myname = "*"
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement