viết thủ tục giải phương trình bậc nhất ax+b=0

By Allison

viết thủ tục giải phương trình bậc nhất ax+b=0

0 bình luận về “viết thủ tục giải phương trình bậc nhất ax+b=0”

  1. 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.

    Trả lời

Viết một bình luận