daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <unordered_set>
  5. #include <limits>
  6. #include <cmath>
  7. #include <iomanip>
  8. #include <algorithm>
  9. #include <cassert>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. double dist(double x1, double y1, double x2, double y2){
  15.     return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
  16. }
  17.  
  18. int32_t main() {
  19.     freopen("input.txt", "r", stdin);
  20.     freopen("output.txt", "w", stdout);
  21.     double x1,y1;
  22.     double x2,y2;
  23.     double x3,y3;
  24.     cin>>x1>>y1>>x2>>y2>>x3>>y3;
  25.     double a = dist(x1,y1, x2, y2);
  26.     double b = dist(x1,y1, x3, y3);
  27.     double c = dist(x2,y2, x3, y3);
  28.     double p = a+b+c;
  29.     int ans = 1e-3 + sqrt(p*(p-a*2)*(p-b*2)*(p-c*2));
  30.     cout<<ans;
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top