Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int a1, b1, c1, a2, b2, c2;
  6. float D, Dx, Dy, x, y;
  7.  
  8. int main()
  9. {
  10. cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2 ;
  11. D = a1 * b2 - a2 * b1;
  12. Dx = c1 * b2 - c2 * b1;
  13. Dy = a1 * c2 - a2 * c1;
  14. if (D == 0)
  15. {
  16. if (Dx + Dy == 0)
  17. cout << "He phuong trinh co vo so nghiem" ;
  18. else
  19. cout << "He phuong trinh vo nghiem" ;
  20. }
  21. else
  22. {
  23. x = Dx / D;
  24. y = Dy / D;
  25. cout << "He phuong trinh co nghiem (x, y) =" << x << " , " << y ;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement