Program GIAI_PHUONG_TRINH_BAC_NHAT;
Var a,b,x:real;
Begin
Clrscr;
Writeln('GIAI PHUONG TRINH BAC NHAT: AX + B=0');
Writeln('--------------------------------------');
Write ('Nhap a= '); readln(a);
Write ('Nhap b= ');readln(b);
If (a=0) then
If (b=0) then
Writeln(' Phuong trinh co vo so nghiem')
Else
writeln(' Phuong trinh vo nghiem')
Else
Writeln('Phuong trinh co nghiem x=',-b/a:4:2);
Readln;
End.
Program BAT_PHUONG_TRINH_BAC_NHAT;
Uses crt;
Var a,b: real;
Begin
Clrscr;
Writeln('GIAI BAT PHUONG TRINH BAC NHAT: AX + B>=0');
Writeln('--------------------------------------');
Write('nhap a=');readln(a);
Write('nhap b=');readln(b);
If a<>0 then
If a>0 then Writeln('Bat phuong trinh co nghiem: x>=',-b/a:4:2)
Else Writeln('Bat phuong trinh co nghiem: x<=',-b/a:4:2)
Else
If b>=0 then Writeln('Bat phuong trinh co vo so nghiem')
Else writeln('Bat phuong trinh vo nghiem');
Readln;
End.
Ý kiến bạn đọc
Những tin cũ hơn