Accelerated C++:通过示例进行编程实践——练习解答(第15章)
来源:互联网 发布:linux 配置lnmp 编辑:程序博客网 时间:2024/05/16 00:54
我的Github地址:https://github.com/CNhoward/Accerlerated-C-plus-plus
本节习题与11、12、13、14等都相关,相关习题解决也基本相同,故可以参考前面章节,本节习题代码见Github。
15-0. Compile, execute, and test the programs in this chapter.
Ans:见Github
15-1. Test your system by writing a program that executes
Picture p = // some initial starting picturePicture q = frame(p);Picture r = hcat(p, q) ;Picture s = vcat(q, r);cout << frame(hcat(s, vcat(r, q))) << endl;
Ans:见Github
15-2. Reimplement the Frame_Pic
class so that the frame uses three different characters: one for the corners, another for the top and bottom borders, and a third for the side borders.
Ans:见Github
15-3. Give users the option to specify what characters to use for these border characters.
Ans:见Github
15-4. Add an operation to reframe
a Picture
, which changes the frame characters. The operation should change all of the frames in the interior picture.
Ans:见Github
15-5. Reimplement HCat_Pic
so that when pictures of a different size are concatenated, the shorter one is centered in the space consumed by the longer one. That is, if we horizontally concatenate two pictures, one of which is four lines long and the other is two lines long, the first and last rows of the output picture will be blank on the side of the shorter picture. What can we now conclude about the necessity of the tests betweenrow
and 0.
Ans:见Github
15-6. The Vec
and str
classes that we developed in Chapters 11 and 12 are powerful enough to be used to implementPicture
s. Reimplement the material in this chapter to useVec<str>
instead ofvector<string>
, and test your implementation.
Ans:见Github
- Accelerated C++:通过示例进行编程实践——练习解答(第15章)
- Accelerated C++:通过示例进行编程实践——练习解答(第0章)
- Accelerated C++:通过示例进行编程实践——练习解答(第1章)
- Accelerated C++:通过示例进行编程实践——练习解答(第2章)
- Accelerated C++:通过示例进行编程实践——练习解答(第3章)
- Accelerated C++:通过示例进行编程实践——练习解答(第4章)
- Accelerated C++:通过示例进行编程实践——练习解答(第5章)
- Accelerated C++:通过示例进行编程实践——练习解答(第6章)
- Accelerated C++:通过示例进行编程实践——练习解答(第7章)
- Accelerated C++:通过示例进行编程实践——练习解答(第8章)
- Accelerated C++:通过示例进行编程实践——练习解答(第9章)
- Accelerated C++:通过示例进行编程实践——练习解答(第10章)
- Accelerated C++:通过示例进行编程实践——练习解答(第11章)
- Accelerated C++:通过示例进行编程实践——练习解答(第12章)
- Accelerated C++:通过示例进行编程实践——练习解答(第13章)
- Accelerated C++:通过示例进行编程实践——练习解答(第14章)
- Accelerated C++:通过示例进行编程实践——练习解答(第16章)
- Accelerated C++:通过示例进行编程实践——习题解答(第1章)
- 转 不规则三角网(TIN) 慕名GIS
- Shell脚本防攻击一例
- java IO 下载
- JSON和JSONP (含jQuery实例)
- tpcc-mysql 安装
- Accelerated C++:通过示例进行编程实践——练习解答(第15章)
- jquery 解析两次json数据
- Android中的UID、GID与应用安全
- tionElementCollection节点
- UVA11770 - Lighting Away
- Zookeeper的应用场景
- ReadOnlyCollection 的使用
- Android悬浮窗实现 使用WindowManager
- android 非框架 分时图和K线图分时图(四)