| 查看: 765 | 回复: 2 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
[求助]
运行以下程序,cuboid1的体积和cuboid2 的体积分别是多少? 已有1人参与
|
||
|
//Cuboid.h class Cuboid { public: void setCuboid(double l=2., double w=2., double h=2.); double getVolume(); private: double Length, double Width, double Heigth; }; //Cuboid.cpp #include "Cuboid.h" void Cuboid::setCuboid(double l, double w, double h){ Length = l; Width = w; Heigth = h; } double Cuboid::getVolume(){ return Length * Width * Heigth ; } #include <iostream> using namespace std; #include "Cuboid.h" void main(){ Cuboid cuboid1,cuboid2; cuboid1.setCuboid(); cuboid2.setCuboid (3, 4, 5); cout<<" cuboid1的体积=" << cuboid1.getVolume()<<endl<<endl; cout<<" cuboid2的体积=" << cuboid2.getVolume()<<endl<<endl; } |
» 猜你喜欢
欢迎发来filecode的Mz6后的代码验证其规律
已经有49人回复
咱们一起用铁证分析2026国家社科基金中标与否
已经有21人回复
哪位老哥知道今年的国自然具体哪一天放榜?
已经有5人回复
国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率
已经有8人回复
各位道友,我要去昆明玩几天,回来见。
已经有7人回复
filecode
已经有10人回复
奇怪,两个人的filecode固定段从头到尾一模一样
已经有11人回复
有时候,自然基金真的不能太认真 (我的申报经验)
已经有8人回复
应该是93bebmhtak前后十一个字符比较关键
已经有37人回复
好奇怪的filecode
已经有7人回复

zeppe
金虫 (小有名气)
- 应助: 15 (小学生)
- 金币: 3901.3
- 散金: 58
- 红花: 4
- 帖子: 205
- 在线: 254.1小时
- 虫号: 573594
- 注册: 2008-06-14
- 性别: GG
- 专业: 理论和计算化学
3楼2014-07-16 14:33:42
2楼2014-07-16 11:31:10










回复此楼