>>958 さんくす!とりあえずなおした。
#include <stdio.h>
#include <math.h>
struct point{ double x; double y;} Polygon[100];
typedef struct point point;
double Length(point A,point B){ return sqrt( (A.x - B.x) * (A.x - B.x) + (A.y - B.y) *(A.y - B.y) ); }
double TriArea(point A,point B,point C){ double a = Length(B,C) , b = Length(A,C), c = Length(A,B) , s = (a+b+c)/2.0; return sqrt(s*(s-a)*(s-b)*(s-c) );}
point TriCenter(point A,point B,point C){ point ret; ret.x = (A.x + B.x + C.x) / 3.0; ret.y = (A.y + B.y + C.y) / 3.0; return ret;}
int main(){
int i,n=5;double AreaTotal,area; point O,R,C;
Polygon[0].x = 3.0; Polygon[0].y = 9.0; Polygon[1].x = 3.0; Polygon[1].y = 16.0;
Polygon[2].x = 5.0; Polygon[2].y = 18.0;Polygon[3].x = 6.0; Polygon[3].y = 12.0;
Polygon[4].x = 5.0; Polygon[4].y = 6.0; Polygon[5].x = 3.0; Polygon[5].y = 9.0; // [0]
O.x = 0.0; O.y = 0.0; for(i=0;i<n;i++){ O.x += Polygon[i].x; O.y += Polygon[i].y;}O.x /= (double)n; O.y /= (double)n;
R.x = 0.0; R.y = 0.0;AreaTotal=0.0; for(i=0;i<n;i++){
C = TriCenter(O,Polygon[i],Polygon[i+1]);AreaTotal += area = TriArea(O,Polygon[i],Polygon[i+1]);
R.x += C.x * area; R.y += C.y * area;}
R.x /= AreaTotal; R.y /= AreaTotal; printf("%lf %lf\n",R.x,R.y);return 0;}