第五周作业 长方形
来源:互联网 发布:水淀粉挡子弹知乎 编辑:程序博客网 时间:2024/04/27 19:15
/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:谭泽纯
*版本:v6.0
*
*问题描述:长方形
*输入描述:无
*程序输出:
*/
#include<iostream>
using namespace std;
class Bulk
{
private:
int length;
int width;
int height;
public:
Bulk(int l,int w,int h):length(l),width(w),height(h){}
void set()
{
cin>>length>>width>>height;
}
int volume()
{
return length*width*height;
}
int areas()
{
return 2*(length*width+length*height+width*height);
}
};
int main()
{
Bulk a(1,2,3),b(4,5,6),c(7,8,9);
a.set();
b.set();
c.set();
cout<<a.volume()<<a.areas()<<endl;
cout<<b.volume()<<b.areas()<<endl;
cout<<c.volume()<<c.areas()<<endl;
}
0 0
- 第五周作业 长方形
- 第五周作业 长方形
- 第五周—长方形面积
- 第五周 计算长方形面积
- 第五周项目五-长方形类
- 第五周 项目4 长方形类
- 第五周项目—raptor长方形面积
- 第五讲作业,输入长方形的边长,输出发现面积与周长
- 第五周作业
- 第五周作业
- 第五周作业 2
- 第五周作业 3
- 第五周作业 1
- 第五周作业1
- 第五周作业2
- 第五周作业3
- 第五周作业
- 第五周作业
- 利用图搜索来优化八数码问题的A*算法
- [HNOI2016]树
- POJ 1039 Pipe (直线与线段间的关系)
- 《C和指针》读书笔记(三)
- Java 对象Serializable
- 第五周作业 长方形
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path表头报错解决
- 二分查找(折半查找)
- 文本语言模型的参数估计-最大似然估计、MAP及贝叶斯估计
- 线程和进程的区别
- leetcode Invert Binary Tree
- android图形美化
- 使用malloc动态定义数组
- D