pascal_pt_bac2
program giai_PT_bac_2
var
a,b,c,d,x,x1,x2:real
begin
wite('a=');readln(a);
wtite('b=');readln(b);
write('c=');readln(c);
If a=0 then writeln('khong phai pt bac hai');
else
begin
d:=b*b-4ac
if d<0 then writeln('pt vo nghiem') ;
if d=0 then
begin
x:=-b/(2a);
writeln('nghiem kep x=',x:8:3);
end;
if d>0 then
begin
x1:=(-b+sqrt d)/(2a);
x2:=(-b-sqrt d)/(2a);
writeln('x1=',x1:8:3);
writeln('x2=',x2:8:3);
end;
end;
readln;
end.
Bạn đang đọc truyện trên: Truyen247.Pro