>453
class triangle{
struct pos_ { double x,y; } *tbl;
public:
triangle(){
tbl = new struct pos_ [3];
tbl[0].x = 1.0; tbl[0].y = 1.0;
tbl[1].x = 3.0; tbl[1].y = -1.0;
tbl[2].x = 2.0; tbl[2].y = -2.0;
}
~triangle() { delete [] tbl; }
double calcArea(){
double s, a, b, c;
a = calcDist(tbl[0], tbl[1]);
b = calcDist(tbl[1], tbl[2]);
c = calcDist(tbl[2], tbl[0]);
s = (a + b + c) / 2.0;
return sqrt(s * (s - a) * (s - b) * (s - c));
}
private:
double calcDist(struct pos_ a, struct pos_ b){
double dx, dy;
dx = a.x - b.x;
dy = a.y - b.y;
return sqrt(dx * dx + dy * dy);
}
};

...C++はよくわからんのだ(;´Д`)