PascalABC.NET
begin
var (a, b, c) := ReadReal3('Введите a, b, c:');
if a = 0 then exit;
var D := sqr(b) - 4 * a * c;
println('Дискриминант:',D);
if D > 0 then begin
print('x1 =',(-b+sqrt(D))/(2*a));
print('x2 =',(-b-sqrt(D))/(2*a));
end
else if D = 0 then
print('x =', -b / (2 * a))
else if D < 0 then
print('Корней нет');
end.
PascalABC.NET
begin
var (a, b, c) := ReadReal3('Введите a, b, c:');
if a = 0 then exit;
var D := sqr(b) - 4 * a * c;
println('Дискриминант:',D);
if D > 0 then begin
print('x1 =',(-b+sqrt(D))/(2*a));
print('x2 =',(-b-sqrt(D))/(2*a));
end
else if D = 0 then
print('x =', -b / (2 * a))
else if D < 0 then
print('Корней нет');
end.