Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int x1,y1,x2,y2,x3,y3;
- double a,b,c,s,p,r;
- cin >>x1>>y1>>x2>>y2>>x3>>y3;
- a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
- b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
- c = sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
- p =(a + b + c)/2;
- s = sqrt(p * (p - a) * (p - b) * (p - c));
- r = (a*b*c)/(4*s);
- cout.setf(ios::fixed | ios::showpoint);
- cout.precision(3);
- if(s == 0)
- {
- cout << 3.141592653589793238462643383279 *(max(max(a,b),max(a,c))) <<endl;
- return 0;
- }
- cout << 2 * 3.141592653589793238462643383279 * r << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement