Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Main()
- Dim myname As String
- Dim nom(25) As String
- Dim cmp As Integer = 0
- Dim fin As Integer = 0
- Dim reponse As MsgBoxResult
- Dim motLePlusPetitDejaVu As String
- Do
- ' Entree des noms
- myname = InputBox("Entrer un nom", "InputBox Demo")
- nom(cmp) = myname
- cmp = cmp + 1
- Loop Until myname = "*"
- motLePlusPetitDejaVu = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
- For compteur As Integer = 0 To cmp - 2
- If String.Compare(motLePlusPetitDejaVu, nom(compteur)) > 0 Then
- motLePlusPetitDejaVu = nom(compteur)
- reponse = MsgBox("Est-ce le plus petit nom " & nom(compteur), MsgBoxStyle.YesNo, "Classement du plus petit")
- If reponse = MsgBoxResult.Yes Then
- MsgBox("Le nom le plus petit est " & nom(compteur), MsgBoxStyle.OkOnly, "Classement du plus petit")
- Exit Sub
- End If
- End If
- Next
- MsgBox("Il n'y a pas de plus petit validé")
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement