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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#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;
}
void display(){
cout << x << " " << y << " " << 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);
}
double getA(){
return a;
}
double getB(){
return b;
}
double getC(){
return c;
}
void display(){
cout << a << " " << b << " " << c;
}
}
class paramtr : public treug{
private:
double p, s;
public:
paramtr(points q, points w, points e) :treug(q, w, e) {
p = (getA() + getB() + getC()) / 2;
s = sqrt(p*(p-getA())*(p-getB())*(p-getC()));
}
void display(){
cout << p << " " << s;
}
}
int main(){
return 0;
}