uses crt;
var
d,a,b,c,x₁,x₂:real;
begin
writeln('Введите a,b,c');
readln(a,b,c);
d: = b × b - 4 × a × c;
if d > 0 then
x₁ : = (-b + sqrt(d)) / (2 * a);
x₂ := (-b - sqrt(d)) / (2 * a);
writeln('x1 = ', x1:2:2);
writeln('x2 = ', x2:2:2);
end
else if d = 0 then
x₁ : = -b / (2 × a);
writeln('x = ', x1:2:2);
else
writeln('Нет действительных корней');
end.
uses crt;
var
d,a,b,c,x₁,x₂:real;
begin
writeln('Введите a,b,c');
readln(a,b,c);
d: = b × b - 4 × a × c;
if d > 0 then
begin
x₁ : = (-b + sqrt(d)) / (2 * a);
x₂ := (-b - sqrt(d)) / (2 * a);
writeln('x1 = ', x1:2:2);
writeln('x2 = ', x2:2:2);
end
else if d = 0 then
begin
x₁ : = -b / (2 × a);
writeln('x = ', x1:2:2);
end
else
writeln('Нет действительных корней');
end.