#include<iostream>
using namespace std;
class v
{
public:
void volume()
{
int vo;
cin>>length>>width>>height;
vo=length*width*height;
cout<<vo;
}; //这热的分号可要可不要
private:
int length,width,height;
}; //这儿的分号一定要打
int main()
{
v v1,v2,v3;
v1.volume(); //这儿的括号一定要打
return 0;
}
将类声明头文件、类实现文件、类的使用文件(主文件)放在一起的时候应该注意的问题
最新推荐文章于 2023-10-11 21:12:34 发布