Copie o código do código da seguinte forma:
<html>
<cabeça>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Calculadora online de equações quadráticas</title>
</head>
<corpo>
<nome do formulário="fquad">
<p align="center">Resolvendo equações quadráticas<br>
</p>
<tabela alinhar="centro">
<corpo>
<tr>
<td bgcolor="#990000">
<h2><font color="#ffffff"><input size="4" name="fa" type="text"> x<sup>2</sup>+ <input size="4" name=" fb" type="text"> x + <input size="4" name="fc" type="text"> = 0 <input onclick="checkQuad()" type="button" value="Solution" > <input type="reset" value="Redefinir"> </font></h2>
<p align="center"><font color="#ffffff" face="Arial"><b>Solução de equação quadrática</b></font></p>
</td>
</tr>
<tr>
<td bgcolor="#990000">
<h2><font color="#ffffff">x<sub><a style="text-decoration: none" ><font color="#ffffff">1</font></a></sub> =<input size="45" name="x1" type="text"> <br>
x<sub>2</sub>=<input size="45" name="x2" type="text"> </font></h2>
</td>
</tr>
<tr>
</tr>
</tbody>
</tabela>
</form>
<p align="center">Feito por CRoot</p>
<linguagem script="JavaScript">
<!--
var rootparti;
var parte raiz;
var det;
var rootparti1;
var rootparti2;
var a;
var b;
var c;
varx1;
varx2;
var eu = "eu";
function verificaçãoQuad() {
var a = document.fquad.fa.value;
var b = document.fquad.fb.value;
var c = document.fquad.fc.value;
se (uma == 0 && c! = 0) {
x1 = -c/b;
x2 = "Não é uma equação quadrática, mas aqui está sua resposta para x";
document.fquad.x1.value=x1;
document.fquad.x2.value=x2;
}
senão if (a == "" && c!= 0) {
x1 = -c/b;
x2 = "Não é uma equação quadrática";
document.fquad.x1.value=x1;
document.fquad.x2.value=x2;
}
outro {
quádruplo();
}
}
função quádrupla() {
var a = document.fquad.fa.value;
var b = document.fquad.fb.value;
var c = document.fquad.fc.value;
det = Math.pow(b,2) - 4 * a * c;
parte raiz = Math.sqrt(det) / (2 * a);
rootparti = (Math.sqrt(-det) / (2 * a)) + i;
if (parseFloat(rootparti) < 0) {
rootparti1 = rootparti;
rootparti2 = (-1 * parseFloat(rootparti)) + i;
}
outro {
rootparti1 = (-1 * parseFloat(rootparti)) + i;
rootparti2 = rootparti;
}
if (rootparti1 == "1i") {
rootparti1 = eu;
rootparti2 = "-i";
}
senão if (rootparti1 == "-1i") {
rootparti1 = "-i";
rootparti2 = eu;
}
se (det == 0) {
x1 = x2 = -b/(2*a);
}
senão if (det > 0) {
x1 = (-b + Math.sqrt(det)) / (2 * a);
x2 = (-b - Math.sqrt(det)) / (2 * a);
}
senão se ((-b / (2 * a)) == 0) {
x1 = rootparti1;
x2 = rootparti2;
}
outro {
x1 = (-b / (2 * a) + " + " + rootparti1);
x2 = (-b / (2 * a) + " + " + rootparti2);
}
document.fquad.x1.value=x1;
document.fquad.x2.value=x2;
}
// resolverá números complexos
// -->
</script>
</body>
</html>