#include<stdio.h>
#include<iostream>
#include<wchar.h>
#include<cstdlib>
#include<iomanip>
using namespace std;
class Box
{
private:
int h, w, d;
public:
Box(int , int , int);
~Box();
int volume();
};
Box::Box(int a, int b, int c)
{
h=a;
w=b;
d=c;
}
Box::~Box ()
{
}
int Box::volume ()
{
return h*w*d;
}
int main()
{
Box v(1,2,3);
int m=v.volume ();
cout << m<< endl;
}
时间: 2024-10-13 08:04:46