kot_mapku3

1 I

Jun 2nd, 2020
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5. int main(){
  6.     int x;
  7.     int y;
  8.     cin >>x>>y;
  9.     int a;
  10.     int b;
  11.     cin >>a>>b;
  12.     int k;
  13.     int l;
  14.     cin >>k>>l;
  15.     int q;
  16.     if (x>a){
  17.         q=x-a;
  18.     }else{
  19.         q=a-x;
  20.     }
  21.     int w;
  22.     if (y>b){
  23.         w=y-b;
  24.     }else{
  25.         w=b-y;
  26.     }
  27.     int e;
  28.     if (x>k){
  29.         e=x-k;
  30.     }else{
  31.         e=k-x;
  32.     }
  33.     int r;
  34.     if (y>l){
  35.         r=y-l;
  36.     }else{
  37.         r=l-y;
  38.     }
  39.     int t;
  40.     if (a>k){
  41.         t=a-k;
  42.     }else{
  43.         t=k-a;
  44.     }
  45.     int u;
  46.     if (b>l){
  47.         u=b-l;
  48.     }else{
  49.         u=l-b;
  50.     }
  51.     int i=q*q+w*w;
  52.     int o=e*e+r*r;
  53.     int p=t*t+u*u;
  54.     double s;
  55.     double d;
  56.     double f;
  57.     s=sqrt(i);
  58.     d=sqrt(o);
  59.     f=sqrt(p);
  60.     double h;
  61.     h=(s+d+f)/2;
  62.     double j;
  63.     j=h*(h-s)*(h-d)*(h-f);
  64.     double c;
  65.     c=sqrt(j);
  66.     cout << setprecision(15) << c;
  67.  
  68.     return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment