[tin] Viết chương trình.

L

lamdetien36

Mã:
var
    a, b, c, d, e, f, dd, dx, dy: integer;
begin
    writeln('Nhap He So Phuong Trinh Thu Nhat: '); readln(a, b, c);
    writeln('Nhap He So Phuong Trinh Thu Hai : '); readln(d, e, f);
    dd := a * e - b * d;
    dx := c * e - b * f;
    dy := a * f - c * d;
    if dd <> 0 then
    begin
        writeln('X = ', dx / dd : 0 : 6);
        writeln('Y = ', dy / dd : 0 : 6);
    end
    else
    begin
        if (dx <> 0) or (dy <> 0) then
            writeln('He Vo Nghiem')
        else
            writeln('He Vo So Nghiem');
    end;
    readln
end.
 
Top Bottom