ha = (2 * s) / a hb = (2 * s) / b hc = (2 * s) / c if ha > hb and ha > hc then msgbox "La ligne ha est la plus grande" elseif hb > ha and hb > hc then msgbox "La ligne hb est la plus grande" elseif hc > ha and hc > hb then msgbox "La ligne hc est la plus grande" end if
p = a + b + c
Private Sub CommandButton3_Click() Dim a As Single, b As Single, c As Single, p As Single a = toto("longueur du côté a du triangle.") b = toto("longueur du côté b du triangle.") c = toto("longueur du côté c du triangle.") p = a + b + c MsgBox "le périmètre de ce triangle est donc " & p End Sub Private Function toto(msg As String) As Single toto = 0 Do While Not IsNumeric(toto) Or toto = 0 toto = Application.InputBox(Title:=msg, prompt:="un nombre entier ou decimal uniquement" & vbCrLf & "séparateur décimal : ,", Type:=1) Loop End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questions = Sqr(demi * ((demi - a) + (demi - b) + (demi - c)))