<html>
<head>
<title></title>
<script>
function Equatic(a, b, c) {
return [
(-b - Math.sqrt(b ** 2 - 4 * a * c)) / (2 * a),
(-b + Math.sqrt(b ** 2 - 4 * a * c)) / (2 * a)
]
}
function Interact(form) {
const solution = Equatic(form.a.value, form.b.value, form.c.value);
form.solution1.value = `x = ${solution[0]}`;
form.solution2.value = `x = ${solution[1]}`;
form.equation.value = `${form.a.value}x\u00B2 + ${form.b.value}x + ${form.c.value} = 0`.replaceAll("+ -", "- ");
}
</script>
</head>
<body>
<form onchange='Interact(this)'>
a = <input name=a type=number value=1><br>
b = <input name=b type=number value=10><br>
c = <input name=c type=number value='-24'><hr>
Уравнение: <output name=equation></output><hr>
Решение №1: <output name=solution1></output><br>
Решение №2: <output name=solution2></output>
</form>
</body>