var
a, b, c, D: real;
begin
write('A= ');readln(a);
write('B= ');readln(b);
write('C= ');readln(c);
D := b * b - 4 * a * c;
if D < 0 then
writeln('Нет корней')
else
if D = 0 then
writeln('x1=', -b / (2 * a))
if D > 0 then
writeln('x1= ', (-b - sqrt(d)) / (2 * a));
writeln('x2= ', (-b + sqrt(d)) / (2 * a));
end;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var
a, b, c, D: real;
begin
write('A= ');readln(a);
write('B= ');readln(b);
write('C= ');readln(c);
D := b * b - 4 * a * c;
if D < 0 then
writeln('Нет корней')
else
if D = 0 then
writeln('x1=', -b / (2 * a))
else
if D > 0 then
begin
writeln('x1= ', (-b - sqrt(d)) / (2 * a));
writeln('x2= ', (-b + sqrt(d)) / (2 * a));
end;
end.