program PTB2;
uses crt;
var
a,b,c,D:real;
begin
clrscr;
write('Nhap he so a: ');readln(a);
write('Nhap he so b: ');readln(b);
write('Nhap he so c: ');readln(c);
D:=(b*b-4*a*c);
if a=0 then writeln('Phuong trinh tro thanh bac nhat co nghiem X= ',-c/b:2:2)
else begin
if D<0 then writeln('Phuong trinh VO NGHIEM')
else begin
if D=0 then writeln('Phuong trinh co nghiem kep X= ',-b/(2*a):2:2)
else begin
writeln('Phuong trinh co 2 nghiem phan biet:');
writeln('X1= ',(-b-sqrt(d))/2*a:2:2);
writeln('X2= ',(-b+sqrt(d))/2*a:2:2);
end;
end;
end;
readln;
end.
uses crt;
var
a,b,c,D:real;
begin
clrscr;
write('Nhap he so a: ');readln(a);
write('Nhap he so b: ');readln(b);
write('Nhap he so c: ');readln(c);
D:=(b*b-4*a*c);
if a=0 then writeln('Phuong trinh tro thanh bac nhat co nghiem X= ',-c/b:2:2)
else begin
if D<0 then writeln('Phuong trinh VO NGHIEM')
else begin
if D=0 then writeln('Phuong trinh co nghiem kep X= ',-b/(2*a):2:2)
else begin
writeln('Phuong trinh co 2 nghiem phan biet:');
writeln('X1= ',(-b-sqrt(d))/2*a:2:2);
writeln('X2= ',(-b+sqrt(d))/2*a:2:2);
end;
end;
end;
readln;
end.