Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. long long x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  8. long long abx = x2 - x1;
  9. long long aby = y2 - y1;
  10. long long acx = x3 - x1;
  11. long long acy = y3 - y1;
  12. long long S = abs(abx * acy - aby * acx);
  13. cout << S / 2;
  14. if (S % 2 != 0) cout << ".5";
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement