Ответ:
var a,b,c, x1,x2,D: real;
begin
writeln(' а,б,с : ');
readln(a,b,c);
D := b*b - 4*a*c;
if D<0 then writeln('нет ответа') ;
if D=0 then
x1 := -b/2/a;
writeln('х1 : ',x1:0:3);
end;
if D>0 then
x1 := (-b-sqrt(D))/2/a;
x2 := (-b+sqrt(D))/2/a;
writeln('х1 и х2: x1=',x1:0:3,' x2=',x2:0:3);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
var a,b,c, x1,x2,D: real;
begin
writeln(' а,б,с : ');
readln(a,b,c);
D := b*b - 4*a*c;
if D<0 then writeln('нет ответа') ;
if D=0 then
begin
x1 := -b/2/a;
writeln('х1 : ',x1:0:3);
end;
if D>0 then
begin
x1 := (-b-sqrt(D))/2/a;
x2 := (-b+sqrt(D))/2/a;
writeln('х1 и х2: x1=',x1:0:3,' x2=',x2:0:3);
end;
end.