1 #include <iostream> #include <initializer_list> template <typename T> T average_list(std::…
分类:C++ Primer Plus 编程练习
C++ Primer Plus [第六版]第17章编程练习题答案
1 #include <iostream> int main() { using namespace std; char ch; cout << "输入字符计数[$停止]: \n"; int co…
C++ Primer Plus [第六版]第16章编程练习题答案
1 #include <iostream> #include <string> bool Palindrome(const std::string &st); int main() { u…
C++ Primer Plus [第六版]第15章编程练习题答案
1 随便用了示例的程序测试,懒得写互动程序 #ifndef TV_H_ #define TV_H_ class Remote; class Tv { private: int state; //TV状态 int volu…
C++ Primer Plus [第六版]第14章编程练习题答案
这章真的好难,有点头大,关系多的绕的头疼 1 #ifndef WINEC_H_ #define WINEC_H_ #include <iostream> #include <string> #in…
C++ Primer Plus [第六版]第13章编程练习题答案
1 #ifndef CD_H_ #define CD_H_ class Cd { private: char performers[50]; //歌手 char label[20]; //公司 int selection…
C++ Primer Plus [第六版]第12章编程练习题答案
1 #ifndef COW_H_ #define COW_H_ class Cow { private: char name[20]; char *hobby; double weight; public: Cow();…
C++ Primer Plus [第六版]第11章编程练习题答案
1. 修改程序清单11.5,使之将一系列连续的随机漫步者位置写入到文件中。对于每个位置,用步号进行标志。另外,让该程序将初始条件(目标距离和步长)以及结果小结写入到该文件中。该文件的内容与下面类似: Target Dis…
C++ Primer Plus [第六版]第10章编程练习题答案
1. #ifndef BANK_H_ #define BANK_H_ #include <string> class Bank { private: std::string name; std::string…
C++ Primer Plus [第六版]第9章编程练习题答案
1 #ifndef GOLF_H_ #define GOLF_H_ const int Len = 40; struct golf { char fullname[Len]; int handicap; }; void …