Cоставить программу для решения квадратного уравнения ax^2+bx+c=0
var a,b,c,d:real;beginreadln(a,b,c);d:=sqr(b)-4*a*c;if d<0 then writeln('Net kornei');if d=0 then writeln('x=',-b/(2*a));if d>0 then writeln('x1=', (-b-sqrt(d))/(2*a),' x2=',(-b+sqrt(d))/(2*a));end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var a,b,c,d:real;
begin
readln(a,b,c);
d:=sqr(b)-4*a*c;
if d<0 then writeln('Net kornei');
if d=0 then writeln('x=',-b/(2*a));
if d>0 then writeln('x1=', (-b-sqrt(d))/(2*a),' x2=',(-b+sqrt(d))/(2*a));
end.