第一周项目二
来源:互联网 发布:三菱plc模拟量编程 编辑:程序博客网 时间:2024/05/22 11:42
/* *Copyright (c)2015,烟台大学计算机与控制工程学院 *All rights reserved. *文件名称:score.cpp *作 者:战九州 *完成日期:2015年3月18日 *版 本 号:v1.0 * #include <iostream>#include <cmath>using namespace std;class Volume{public: void set_length( double l); void set_width( double w); void set_heigth( double h); double volume(); double areas();private: double length; double width; double heigth;};void Volume::set_length( double l){ length=l;}void Volume::set_width( double w){ width=w;}void Volume::set_heigth( double h){ heigth=h;}double Volume::volume(){ return length*width*heigth;}double Volume::areas(){ return 2*(length*width+length*heigth+width*heigth);}int main(){ int i; for(i=0; i<3; i++) { double l,w,h; cin>>l>>w>>h; Volume v; v.set_length(l); v.set_width(w); v.set_heigth(h); cout<<v.volume()<<endl; cout<<v.areas()<<endl; } return 0;}
0 0
- 第一周项目二
- 第一周项目二
- 第一周项目二
- 第一周练习题项目一练习二
- 第一周项目二:时间结构体
- 第一周项目二-胖子伤不起
- 第一周 项目二:长方柱类
- 第一周项目二 长方柱类
- 第一周项目二:长方柱类
- 第一周项目二--长方柱类
- 第一周项目二 长方体柱类
- 第一周(春)项目二 胖纸伤不起
- 第一周项目二 长方体的表面积和体积
- 第一周任务二
- 第一周项目三
- 第一周项目一
- 第一周项目三
- 第一周季节项目
- Mycat 水平分表,垂直分表实践(2)
- Unity UGUI——Image(基本属性)
- 第二周 项目3-时间类(2)
- .net学习第十五天
- ReportNG 手把手教你弄测试报告
- 第一周项目二
- 121.Best Time to Buy and Sell Stock
- android-测试so动态库(九)
- Mac OS X 下开发 Android 程序时使用 USB 连真机调试
- 找出最长回文子串
- 第二周项目3-时间类
- oracle的check约束
- Activity的四种启动模式和onNewIntent()
- LeetCode: Binary Tree Depth相关题目合集