include iostream using namespace std class points private double publi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
using namespace std;
class points{
private:
double x, y, z;
public:
points(double x1, double y1, double z1){
x = x1;
y = y1;
z = z1;
}
double getX(){
return x;
}
double getY(){
return y;
}
double getZ(){
return z;
}
}
class treug{
private:
double a, b, c;
public:
double length(points q, points w){
return sqrt((w.getX()-q.getX())*(w.getX()-q.getX())+(w.getY()-q.getY())*(w.getY()-q.getY())+(w.getZ()-q.getZ())*(w.getZ()-q.getZ()));
}
treug(points q, points w, points e){
a = length(q, w);
b = length(e, w);
c = length(q, e);
}
}
class paramtr : public treug{
private:
double p, s;
public:
paramtr(points q, points w, points e) :treug(q, w, e) {
p = (a + b + c) / 2;
}
}
int main(){
}