Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (57.08 KB, 20 trang )
{
Program PhuongTrinhbac2;
Var a,b,c,delta,x1,x2,xk: real;
BEGIN
Writeln('Chuong trinh giai PT bac hai:');
Writeln('Hay nhap cac he so:');
Write('a = '); readln(a);
Write('b = '); readln(b);
Write('c = '); readln(c);
Delta:=b*b-4*a*c;
If Delta > 0 then
Begin
x1:=(-b+Sqrt(Delta))/(2*a);
x2:=(-b-Sqrt(Delta))/(2*a);
Writeln('Phuong trinh co hai nghiem phan
biet:');
Writeln('x1 = ',x1:5:2);
Writeln('x2 = ',x2:5:2);
End
Else If Delta = 0 then
Begin
xk:=-b/(2*a);
Writeln('PT co mot nghiem kep xk =
',xk:5:2);
End
Else Writeln('Phuong trinh vo nghiem...');
Readln
END.
Program Max3;
Var a,b,c,max: Integer;
BEGIN