5 #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 …
C++ Primer Plus [第六版]第9章复习题答案
3 #include <iostream> int main() { double x; std::cout << "请输入值: "; while (!(std::cin >> x))…
C++ Primer Plus [第六版]第8章编程练习题答案
1 #include <iostream> void show(const char *str, int n = 1); int main() { show("hello world!"); show("你好…
C++ Primer Plus [第六版]第8章复习题答案
4. 下面是一个结构模板: struct box { char maker[40]; float height; float width; float length; float volume; }; a. 编写一个函数…
C++ Primer Plus [第六版]第7章编程练习题答案
1 #include <iostream> double num(double x, double y); int main() { using namespace std; double n, m; cou…
C++ Primer Plus [第六版]第7章复习题答案
复习题一般我只把书上写不下的发布出来,其他的都在书上直接做了 8 编写一个函数,其原型如下: int replace(char * str, char c1, char c2); 该函数将字符串中所有的c1都替换为c2,…
C++ Primer Plus [第六版]第6章编程练习题答案
1 #include <iostream> #include <cctype> int main() { using namespace std; char ch; while ((ch = ci…
C++ Primer Plus [第六版]第5章编程练习题答案
1 #include <iostream> int main() { using namespace std; int num1, num2; cout << "请输入第一个整数: "; cin …
C++ Primer Plus [第六版]第4章编程练习题答案
1 #include <iostream> int main() { using namespace std; char first[20]; char last[10]; char deserve; int…