salut je suis ravi d'être ici.
j'ai besoin d'ecrire l'algorithme de l'équationn du second degré
Axx+Bx+c=o
alors je vous en suplis aidez moi svp !!!!
merci ,mille merci !!!!!
NB:xx signifie x au carré
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style>
table, tr{
background-color: #4444ff;
}
#tdHover{
background-color:#8888ff;
color: #eeeeee;
}
a{
text-decoration: none;
}
a:hover{
color: #ffffff;
}
</style>
<script>
function getResult(a,b,c){
//Roots = (-b +/- Sqrt(b*b-4*a*c)) / (2*a)
equation=""+a+"x² + "+b+"x + "+c+" = 0";
html = "L'équation '"+equation+"' <br/>";
if(a==0){
root = -1*c/b;
html += "admet une seule racine [x = -c / b]: " + root;
}else if(b*b!=4*a*c){
root = (-1*parseInt(b))/(2*parseInt(a));
html += "admet une seule racine [x = -b / 2a]: " + root;
}else if(b*b < 4*a*c){
html += "n'admet pas de racine";
}else{
root1 = (-b + Math.sqrt(b*b-4*a*c))/(2*a);
root2 = (-b - Math.sqrt(b*b-4*a*c))/(2*a);
html += "admet deux racines <br/>";
html += "[x1 = (-b + Sqrt(b*b-4*a*c) / 2a]: " + root1 + "<br/>";
html += "[x2 = (-b - Sqrt(b*b-4*a*c) / 2a]: " + root2;
}
document.getElementsByName("result")[0].innerHTML=html;
}
</script>
</head>
<body>
<form>
<input type="text" name="aValue" id="aValue"/> x² + <input type="text" name="bValue" id="bValue"/> x + <input type="text" name="cValue" id="cValue"/> = 0
<p/>
<button onclick="getResult(document.getElementsByName('aValue')[0].value, document.getElementsByName('bValue')[0].value, document.getElementsByName('cValue')[0].value);">Calculer les racines</button>
</form>
<div name="result" id="result" style=""background-color: #dddddd; width: 480; height: 100; border-style: solid;border-width: 1px; border-color: #444444;">
</div>
</body>
</html>
Vous n'aimez pas le lifting de Facebook ? Le site Mashable propose cinq étapes pour revenir à l'ancienne présentation du réseau social.