Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout << fixed << setprecision(47);
  8. long long x, y, a, b, c, z, t, d, e, f, k, l, m, n, p;
  9. long double r, s;
  10. p=0;
  11. cin >> x;
  12. cin >> y;
  13. cin >> z;
  14. cin >> t;
  15. cin >> k;
  16. cin >> l;
  17. cin >> m;
  18. cin >> n;
  19. a=y-t;
  20. b=z-x;
  21. c=-a*x-b*y;
  22. d=l-n;
  23. e=m-k;
  24. f=-d*k-e*l;
  25. if(a*e==d*b)
  26. {
  27. if(f*a==c*d && f*b==c*e) {cout << 2; p=1;}
  28. else
  29. {
  30. cout << 0;
  31. }
  32. }
  33. else
  34. {
  35. cout << 1 << ' ';
  36. s=(long double)(f*a-c*d)/(b*d-e*a);
  37. r=(long double)(f*b-c*e)/(-b*d+e*a);
  38. cout << r << ' ' << s;
  39. }
  40.  
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement