第三周实验报告4修改版
来源:互联网 发布:软件开发项目进度表 编辑:程序博客网 时间:2024/04/30 13:14
#include <iostream>
using namespace std;
class Cfz
{
public:
void get_data();
void display();
private:
int lengh;
int width;
int height;
int volume;
int acreage;
};
void Cfz::get_data()
{
cout<<"请输入长宽高:";
cin>>lengh;
cin>>width;
cin>>height;
}
void Cfz::display()
{
volume=lengh*width*height;
cout<<"长方柱体积为:"<<" "<<volume<<" ";
acreage=2*(lengh*height+width*height+lengh*width);
cout<<"长方柱表面积为:"<<acreage<<endl;
}
int main()
{
Cfz c1,c2,c3;
c1.get_data();
cout<<"第一个长方柱:"<<endl;
c1.display();
c2.get_data();
cout<<"第二个长方柱:"<<endl;
c2.display();
c3.get_data();
cout<<"第三个长方柱:"<<endl;
c3.display();
return 0;
}
- 第三周实验报告4修改版
- 第三周实验报告4
- 第三周实验报告4
- << 第三周实验报告4>>
- 第三周实验报告4
- 第三周实验报告
- 第三周实验报告
- 第三周实验报告
- 第三周实验报告
- 第三周实验报告
- 《第三周实验报告任务4》
- 第三周实验报告(4)
- 第三周实验报告(任务4)
- 下学期第三周实验报告4
- 第三周实验报告 任务4
- 第三周C++实验报告(4)
- 第三周实验报告(4)
- 第十三周实验报告2修改版
- 经典SQL语句大全
- 使用线程加载指定目录下的所有子目录和文件名称到TreeView中
- libpython2.7.so.1.0 cannot open的解决方法
- 迟来的第一周报告
- Silverlight查看CPU使用情况
- 第三周实验报告4修改版
- 位图
- 转:latex中文字体配置
- C++ Primer 第12章 习题12.8
- android按home键不能回到自定义主界面
- 代码注入心得
- Android Failed to allocate memory: 1455
- WPF多线程
- MSP430 延时总结