Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int a1, b1, c1, a2, b2, c2;
- float D, Dx, Dy, x, y;
- int main()
- {
- cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2 ;
- D = a1 * b2 - a2 * b1;
- Dx = c1 * b2 - c2 * b1;
- Dy = a1 * c2 - a2 * c1;
- if (D == 0)
- {
- if (Dx + Dy == 0)
- cout << "He phuong trinh co vo so nghiem" ;
- else
- cout << "He phuong trinh vo nghiem" ;
- }
- else
- {
- x = Dx / D;
- y = Dy / D;
- cout << "He phuong trinh co nghiem (x, y) =" << x << " , " << y ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement