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. Bình luận
Program giaiptbacnhat; Uses crt; Var a,b,x : integer; Begin Clrscr Write(‘ giai phuong trinh bac nhat ax+b=0’); Write(‘ nhap so a’,a); Readln(a); Write(‘nhap so b’,b); Readln(b) If a<>0 then x:=-b/a; Write(‘phuong trinh co 1 nghiem duy nhat la’,x:2:2) Else If a=0 and b=0 then write(‘ phuong trinh co vo so nghiem’); If a=0 and b<>0 then Write(‘phuong trinh vo nghiem’); Readln End. Bình luận
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.
Program giaiptbacnhat;
Uses crt;
Var a,b,x : integer;
Begin
Clrscr
Write(‘ giai phuong trinh bac nhat ax+b=0’);
Write(‘ nhap so a’,a);
Readln(a);
Write(‘nhap so b’,b);
Readln(b)
If a<>0 then
x:=-b/a;
Write(‘phuong trinh co 1 nghiem duy nhat la’,x:2:2)
Else
If a=0 and b=0 then write(‘ phuong trinh co vo so nghiem’);
If a=0 and b<>0 then
Write(‘phuong trinh vo nghiem’);
Readln
End.