2 câu trả lời
program Vd;
uses crt;
var a,b: integer;
procedure Nhap;
begin
write('Nhap a= ');readln(a);
write('Nhap b= ');readln(b);
end;
procedure Xuat(a,b:integer);
begin
If (a=0) and (b=0) then write('Pt co vo so nghiem')
else
If (a=0) and (b<>0) then write('Pt vo nghiem')
else
write('Pt co nghiem la: ',(-1*b)/a);
end;
begin
clrscr;
Nhap;
Xuat(a,b);
readln;
end.
program bai_giai;
uses crt;
var a,b:integer;
procedure giai;
begin
if (a=b) and (b=0) then write('Phuong trinh co vo so nghiem')
else if (a=0) and (b<>0) then write('Phuong trinh vo nghiem')
else write('x = ',(-b)/a:0:2);
end;
BEGIN
clrscr;
write('Nhap a: '); readln(a);
write('Nhap b: '); readln(b);
giai;
readln;
END.