cau 1 (5d) viet chuong trinh giai he phuong trinh tuyet tinh : ax+by=m , cx+dy = n bang pascal va viet lenh
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
Program GIAI_HE_PT_BAC_NHAT_HAI_AN;//3:17
Uses crt;
Var a,b,c,d,m,n:real;
dx,dy,dd:real;
Begin
Clrscr;
Writeln(' GIAI HE PHUONG TRINH BAC NHAT HAI AN:');
Writeln('----------------------------------');
Write('Nhap a=');readln(a);
Write('Nhap b=');readln(b);
Write('Nhap m=');readln(m);
Write('Nhap c=');readln(c);
Write('Nhap d=');readln(d);
Write('Nhap n=');readln(n);
dd:=a*d-b*c;
dx:=m*d-b*n;
dy:=a*n-c*m;
If dd=0 then
If (dx=0) and (dy=0) then
Writeln('He vo so nghiem hoac vo nghiem')
Else writeln('He vo nghiem')
Else
Begin
Write('He co nghiem :');
Writeln('x=',dx/dd:4:2,' va y=',dy/dd:4:2);
End;
Readln;
End.
Tham khảo thôi nha bạn
©bản quyền thuộc về Kanhquann
Hãy giúp mọi người biết câu trả lời này thế nào?
Xem thêm:
CattCoder
Program GiaiHePhuongTrinhTuyenTinh;
uses crt;
Var
a, b, c, d, m, n, x, y, det: Real;
Begin
clrscr;
Write('Nhap a: '); Readln(a);
Write('Nhap b: '); Readln(b);
Write('Nhap c: '); Readln(c);
Write('Nhap d: '); Readln(d);
Write('Nhap m: '); Readln(m);
Write('Nhap n: '); Readln(n);
det := a * d - b * c;
If det = 0 Then
Begin
If (a * n = c * m) and (b * n = d * m) Then
Writeln('He phuong trinh co vo so nghiem.')
Else
Writeln('He phuong trinh vo nghiem.')
End
Else
Begin
x := (m * d - n * b) / det;
y := (a * n - c * m) / det;
Writeln('Nghiem cua he phuong trinh la:');
Writeln('x = ', x:0:2);
Writeln('y = ', y:0:2);
End;
Readln;
End.
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin
44
901
18
bảnq quyền lun ghê v=))
45
765
13
phét cho vui thôi kk