d := sqr (b) - 4 * a * c; if d < 0 then writeln ('Корней нет') else begin x1 := (-b + sqrt (d))/(2*a); x2 := (-b - sqrt (d))/(2*a); if x1 <> x2 then begin writeln ('x1=',x1); writeln ('x2=',x2); s := x1+x2; writeln ('s=',s); end else writeln ('x=s=',x1); end; end.
a,b,c : integer;
d,x1,x2,s : real;
begin
writeln ('ax^2+bx+c=0');
write ('a=');
readln (a);
write ('b=');
readln (b);
write ('c=');
readln (c);
d := sqr (b) - 4 * a * c;
if d < 0 then
writeln ('Корней нет')
else
begin
x1 := (-b + sqrt (d))/(2*a);
x2 := (-b - sqrt (d))/(2*a);
if x1 <> x2 then
begin
writeln ('x1=',x1);
writeln ('x2=',x2);
s := x1+x2;
writeln ('s=',s);
end
else
writeln ('x=s=',x1);
end;
end.