【C++】primer plus 练习7.3
来源:互联网 发布:淘宝代写软文怎么发布 编辑:程序博客网 时间:2024/05/19 18:10
//计算长方体的体积#include<iostream>struct box //结构体{char maker[40];float height;float width;float length;float volume;};void show(box t);void count(box * pt); //传递地址计算体积int main(){using namespace std;box graph;cout <<"Enter graph name :";cin.getline(graph.maker,40);cout <<"height =_\b";cin >>graph.height;cout <<"width =_\b";cin >>graph.width;cout <<"length =_\b";cin >>graph.length;count(&graph);show(graph);return 0;}void show(box t) //显示{using namespace std;cout <<"\tmaker :"<<t.maker<<endl;cout <<"\theight :"<<t.height<<endl;cout <<"\twidth :"<<t.width<<endl;cout <<"\tlength :"<<t.length<<endl;cout <<"\tvolume :"<<t.volume<<endl;}void count(box * pt){pt->volume = pt->height * pt->width * pt->length;}
1 0
- 【C++】primer plus 练习7.3
- 【C++】primer plus 练习7.1
- 【C++】primer plus 练习7.2
- 【C++】primer plus 练习7.5
- 【C++】primer plus 练习8.1
- C Primer Plus 练习p31
- C Primer Plus 练习 P59
- C Primer Plus 练习 P85
- c primer plus 练习一
- C++primer plus第六版课后编程练习答案7.3
- C Primer Plus 练习6-1
- C Primer Plus 练习 6-2
- C Primer Plus 练习 6-3
- C Primer Plus 练习 6-4
- C Primer Plus 练习 6-5
- C Primer Plus 练习 6-6
- C Primer Plus 练习 6-9
- C Primer Plus 练习 6-10
- C++中explicit关键字
- 【C++】primer plus 练习7.2
- git常见操作
- C++虚析构函数、纯虚析构函数
- 跟我一起玩WPF-走进WPF
- 【C++】primer plus 练习7.3
- C++中虚析构函数的作用
- 第二章 循环结构程序设计
- poj 3748 水题位操作
- JProfiler入门使用教程:Eclipse集成
- Action、Menus、ToolBars主窗体构成的实现
- 【C++】primer plus 练习7.5
- tomcat pipline设计模式
- HDU - 5119 Happy Matt Friends(DP)