#include <iostream>
using namespace std;
class Cuboid
{
private:
int length;
int width;
int height;
int result;
public:
void set_value();
void account_value();
void show_value();
};
void Cuboid::set_value()
{
cin >> length;
cin >> width;
cin >> height;
}
void Cuboid::account_value()
{
result = length * width * height;
}
void Cuboid::show_value()
{
cout << "result is : " << result << endl;
}
int main()
{
Cuboid cub1;
cub1.set_value();
cub1.account_value();
cub1.show_value();
Cuboid cub2;
cub2.set_value();
cub2.account_value();
cub2.show_value();
Cuboid cub3;
cub3.set_value();
cub3.account_value();
cub3.show_value();
system("pause");
return 0;
}
|