zoj1090

#include <stdio.h> #include <math.h> #define PI 3.141592653589793 int main(void) { double x1, x2, x3, y1, y2, y3, a1, a2, b1, b2, c1, c2, x, y, d, r; while(scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3)!=EOF) { a1=x2-x1, a2=x3-x1; b1=y2-y1, b2=y3-y1; c1=(x2*x2-x1*x1+y2*y2-y1*y1)*1.0/2; c2=(x3*x3-x1*x1+y3*y3-y1*y1)*1.0/2; d=a1*b2-a2*b1; x=(c1*b2-b1*c2)*1.0/d; y=(a1*c2-a2*c1)*1.0/d; r=sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1)); printf("%.2lf/n", PI*r*2); } return 0; }

你可能感兴趣的:(c,include)