Bạn tham khảo :
program Phuong_trinh_bac_nhat;
uses crt;
var a,b : real;
begin
clrscr;
write ('Nhap so a:'); readln(a);
write ('Nhap so b:'); readln(b);
if (a<>0) then writeln ('Nghiem cua phuong trinh la:', -b/a);
if (a=0) and (b=0) then writeln ('Phuong trinh co vo so nghiem');
if (a=0) and (b<>0) then writeln ('Phuong trinh vo nghiem');
readln
end.