#include <iostream>
using std::cout;
using std::endl; //定义结构
struct Box{
double length;
double width;
double height;
};
double volume(const Box& aBox);
int main(){
Box box={70.0,60.0,40.0};
double boxVolume=volume(box);
cout << "Size of box is:"<<endl
<< "length:"<<box.length<<endl
<<"width:"<<box.width<<endl
<<"height:"<<box.height<<endl;
cout <<"Voluem of box is:"<<boxVolume<<endl;
return 0;
}
//计算体积的函数
double volume(const Box& box){
return box.length*box.width*box.height;
}

版权声明:本文博主原创文章。博客,未经同意不得转载。

最新文章

  1. (转) 将ASP.NET Core应用程序部署至生产环境中(CentOS7)
  2. JS数组经典冒泡排序
  3. LibreOffice去重复数据
  4. transfer between javabean and map
  5. js中改变不同的div属性值的操作
  6. 万网云解析设置二级域名解析到同IP不同端口
  7. 20145317彭垚 java课程总结
  8. WinForm TreeView 三种状态
  9. Android Layout Binder(在线将XML中View find出来,生成java代码的工具)
  10. 如何在GitHub上生成ssh公钥并用NetBeans克隆项目
  11. Ubuntu 16.10的root默认密码设置
  12. Confluence 6 数据库 JDBC 驱动
  13. JAVA中循环删除list中元素的方法总结(同上篇)
  14. sql server 拼接字段
  15. k-近邻算法(KNN)
  16. October 27th, 2017 Week 43rd Friday
  17. ASP.net学习总结
  18. December 03rd 2016 Week 49th Saturday
  19. BZOJ 3123 【SDOI2013】 森林
  20. bzoj1011 遥远的行星

热门文章

  1. mysql常见故障诊断
  2. RISC-V工具链环境(基于Debian/Linux操作系统)
  3. 18、IIC总线驱动程序
  4. [Angular2 Form] patchValue, setValue and reset() for Form
  5. pppoe-环境下的mtu和mss
  6. [D3] Convert Dates to Numeric Values with Time Scales in D3 v4
  7. 用live555将内网摄像机视频推送到外网server,附源代码
  8. ajax跳转到新的jsp页面(局部刷新)
  9. MySQL建立双向主备复制server配置方法
  10. 数据局部性(data locality)