⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tiji.cpp

📁 通过提示
💻 CPP
字号:
// tiji.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
class tiji
{
public:
	void input();
	void jisuan();
	void output();
private:
	float length;
	float width;
	float height;
    float v;
};
void tiji::input()
{
	cin>>length;
	cin>>width;
	cin>>height;
}
void tiji::jisuan()
{
	v=length*width*height;
}
void tiji::output()
{
	cout<<v<<endl;
}
int main(int argc, char* argv[])
{
	tiji v1,v2,v3;
    cout<<"请输入三个长方体的长,宽,高:"<<endl;
	v1.input();
	v2.input();
	v3.input();
	v1.jisuan();
	v2.jisuan();
	v3.jisuan();
    cout<<"三个长方体的体积为:"<<endl;
    v1.output();
	v2.output();
	v3.output();
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -