![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++ Primer Plus 练习题
Guqing_f
努力学习编程的小萌新
展开
-
C++PrimerPlus第十章编程练习答案参考
//bank.h#ifndef BANK_H_#define BANK_H_#include<string>class Bank{ private: std::string m_name; std::string m_id; double m_deposit; public: Bank(); Bank(std::string name, std::string id, double deposit); void show() const; vo...原创 2020-05-26 21:39:58 · 591 阅读 · 2 评论 -
C++Primer Plus第九章编程练习答案参考
这一章感觉看题目意思就老费劲了,要理解半天1.//头文件golf.h#ifndef GOLF_H#define GOLF_Hconst int Len = 40;struct golf{ char fullname[40]; int handicap;};void setgolf(golf &g, const char *name, int hc);int setgolf(golf &g);void handicap(golf &g, int hc);原创 2020-05-17 20:21:59 · 255 阅读 · 0 评论 -
C++ Primer Plus第八章编程练习答案参考
这一章的题目相对来说较少,但是个人认为也比前面的稍难了,还有一道题我做的时候查过别人的答案,发现都是文不对题的,待会会标注出来。1.#include<iostream>using namespace std;int count=0;void show(const char *str, int n=0);int main(){ const char* str = "Good night~"; show(str); show(str,10); show(str,-2);原创 2020-05-12 09:26:03 · 444 阅读 · 0 评论 -
C++ Primer Plus 第五章编程练习答案参考
话不多说直接上代码:1.#include<iostream>using namespace std;int main(){ int a,b, sum=0; cout << "Please enter two numbers:" << endl; cin >> a >> b; if(a>b) { int t = a; a = b; b = t; } for(int i=a; i<=b; i++) {原创 2020-05-10 16:29:33 · 439 阅读 · 0 评论 -
C++ Primer Plus 第六版第六章程序清单6.16(p195)出现的问题
按照书上的代码和输入输出的内容,是无法得到书上运行的答案的,那么问题出现在哪里呢?先附上代码:#include<iostream>#include<fstream>//file I/O support#include<cstdlib>//suport for exit()using namespace std;const int SIZE = 60...原创 2020-04-17 23:20:25 · 339 阅读 · 0 评论 -
关于C++ Primer Plus这本书第四章的练习题
C++ Primer Plus 第四章编程练习第一题:#include<string>using namespace std;int main(){ string firstName, lastName; char grade; int age; cout << "What is your first name? "; getline(cin,firs...原创 2020-04-13 01:14:42 · 195 阅读 · 0 评论