46 lines
642 B
C++
46 lines
642 B
C++
#include <iostream>
|
|
#include <array>
|
|
#include <vector>
|
|
class Cube {
|
|
|
|
public:
|
|
Cube(){}
|
|
Cube(auto _A, auto _B, auto _C): A(_A), B(_B), C(_C){
|
|
}
|
|
public:
|
|
double EvalVolume(){
|
|
return A * B * C;
|
|
}
|
|
std::array<double, 3> GetAll(){
|
|
auto tmp {std::array<double, 3>()};
|
|
tmp[0]=A;
|
|
tmp[1]=B;
|
|
tmp[2]=C;
|
|
return tmp;
|
|
}
|
|
void SetAll(auto _A, auto _B, auto _C){
|
|
A=_A;
|
|
B=_B;
|
|
C=_C;
|
|
}
|
|
void SetA(double x){
|
|
A=x;
|
|
}
|
|
void SetB(double x){
|
|
B=x;
|
|
}
|
|
void SetC(double x){
|
|
C=x;
|
|
}
|
|
const double& GetA(){
|
|
return A;
|
|
}
|
|
const double& GetB(){
|
|
return B;
|
|
}
|
|
const double& GetC(){
|
|
return C;
|
|
}
|
|
private:
|
|
double A, B, C, Volume;
|
|
}; |