Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- int main(){
- int x;
- int y;
- cin >>x>>y;
- int a;
- int b;
- cin >>a>>b;
- int k;
- int l;
- cin >>k>>l;
- int q;
- if (x>a){
- q=x-a;
- }else{
- q=a-x;
- }
- int w;
- if (y>b){
- w=y-b;
- }else{
- w=b-y;
- }
- int e;
- if (x>k){
- e=x-k;
- }else{
- e=k-x;
- }
- int r;
- if (y>l){
- r=y-l;
- }else{
- r=l-y;
- }
- int t;
- if (a>k){
- t=a-k;
- }else{
- t=k-a;
- }
- int u;
- if (b>l){
- u=b-l;
- }else{
- u=l-b;
- }
- int i=q*q+w*w;
- int o=e*e+r*r;
- int p=t*t+u*u;
- double s;
- double d;
- double f;
- s=sqrt(i);
- d=sqrt(o);
- f=sqrt(p);
- double h;
- h=(s+d+f)/2;
- double j;
- j=h*(h-s)*(h-d)*(h-f);
- double c;
- c=sqrt(j);
- cout << setprecision(15) << c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment