 |
|
| Autre version des équations de seconde degré |
| Auteur |
Message |
yoki990
Autorisation : Membre
Nb de messages : 3
Inscrit le : Lun 11 Fév 2013, 16:30
|
Posté le : Lun 11 Fév 2013, 16:48
|
|
|
Texte coloré
Code:
:ClrHome
:Input "A=",A
:Input "B=",B
:Input "C=",C
:If A=0
:Then
:Disp "EQUATION NON 2DE"
:Disp "DEGRE"
:Else
:B^2-4*A*C -> D
:If D<0
:Then
:ClrHome
:Output(1,1,"DELTA=")
:Output(1,7,D)
:Output(2,1,"PAS DE RACINE")
:Output(5,1,"AVEC")
:Output(6,1,"A=")
:Output(6,3,A)
:Output(7,1,"B=")
:Output(7,3,B)
:Output(8,1,"C=")
:Output(8,3,C)
:Pause
:ClrHome
:Else
: (-B - [Racine carré]D) / (2*A) -> E
: (-B + [Racine carré]D) / (2*A) -> F
:If D=0
:Then
:ClrHome
:Output(1,1,"DELTA=)
:Output(1,7,D)
:Output(2,1,"X0=")
:Output(2,4,E)
:Output(5,1,"AVEC")
:Output(6,1,"A=")
:Output(6,3,A)
:Output(7,1,"B=")
:Output(7,3,B)
:Output(8,1,"C=")
:Output(8,3,C)
:Pause
:ClrHome
:Else
:If D>0
:Then
:ClrHome
:Output(1,1,"DELTA=")
:Output(1,7,D)
:Output(2,1,"X1=")
:Output(2,4,E)
:Output(3,1,"X2=")
:Output(3,4,F)
:Output(5,1,"AVEC")
:Output(6,1,"A=")
:Output(6,3,A)
:Output(7,1,"B=")
:Output(7,3,B)
:Output(8,1,"C=")
:Output(8,3,C)
:Pause
:ClrHome
|
 |
|
| |
Google_AdSense
|
Publicité
|
|
|
|
| |
blg_flg
Autorisation : Membre
Nb de messages : 646
Inscrit le : Mer 23 Mai 2012, 17:28
|
Posté le : Lun 11 Fév 2013, 17:32
|
|
|
Ouch! C'est que c'est super pas du tout optimisé, ça! 
|
 |
|
| |
Cytropus
Autorisation : Membre
Nb de messages : 407
Inscrit le : Lun 07 Nov 2011, 12:09
|
Posté le : Dim 17 Fév 2013, 13:15
|
|
|
Salut,
pour une meilleur lisibilité de ton code, utilise les balises
| Code | :ClrHome
:Prompt A,B,C <//- je remplace les Input par un Prompt
:Disp "EQUATION NON 2DE","DEGRE
:If A=/=0
:Then
:ClrHome
:B^2-4*A*C -> D
:If D<0
:Then
:Disp "DELTA=","PAS DE RACINE"," "," ","AVEC","A=","B=","C=
:Output(1,7,D
:Output(6,3,A
:Output(7,3,B
:Output(8,3,C
:Pause
:ClrHome
:Else
: (-B - [Racine carré]D) / (2*A) -> E
: (-B + [Racine carré]D) / (2*A) -> F
:If D=0
:Then
:Output(1,1,"DELTA=","X0="," "," ","AVEC","A=","B=","C=
:Output(1,7,D
:Output(2,4,E
:Output(6,3,A
:Output(7,3,B
:Output(8,3,C
:Pause
:ClrHome
:Else
:Output(1,1,"DELTA=","X1=","X2="," ","AVEC","A=","B=","C=
:Output(1,7,D
:Output(2,4,E
:Output(3,4,F
:Output(6,3,A
:Output(7,3,B
:Output(8,3,C
:Pause
:ClrHome |
J'ai optimisé le plus gros
Bonne continuation à tous !
---------------------- Le nouveau site de tout82 |
 |
|
| |
Google_AdSense
|
Publicité
|
|
|
|
| |
 |
|
|
| |
Page générée en 6 requêtes |
|
|