![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++学习
flannery023
这个作者很懒,什么都没留下…
展开
-
C++ Primer Plus 第六版课后习题答案(第十一章)
第一题:vector.h#ifndef VECTOR_H_#define VECTOR_H_#include <vector>namespace VECTOR{ class Vector { public: enum Mode {RECT, POL}; private: double x; double y; double mag;原创 2021-07-25 18:56:33 · 268 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第十章)
10_1.h#ifndef _10_1_H_#define _10_1_H_#include <string>class BankAccount { public: BankAccount(const std::string& client, const std::string& num, double bal = 0.0); void show() const; void deposit (d.原创 2021-06-26 20:52:34 · 391 阅读 · 3 评论 -
C++ Primer Plus 第六版课后习题答案(第九章)
9.19_1.cpp文件:#include "golf.h"int main(){ golf golfs[3]; for(int i=0; i<3; ++i) { if (setgolf(golfs[i])) showgolf(golfs[i]); else break; }}golf.h:const int Len = 40;struct golf { cha原创 2021-04-26 22:32:41 · 291 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第八章)
8.1#include <iostream>using namespace std;void p1(const string &str, const int times=0){ static int called = 0; int repeat = times>0 ? called : 0; do { cout << str << endl; } while (repeat--);原创 2021-03-12 17:14:58 · 199 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第七章)
C++ Primer Plus 第六版(第七章)的课后习题答案,在main函数中把题号换掉就可以跑不同的程序,第九题单独在这个文章里:https://blog.csdn.net/flannery023/article/details/105617355#include <iostream>using namespace std;double Harmean(doubl...原创 2020-04-19 16:51:56 · 278 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第七章第九题)
为了不破坏原题结构,第九题单独列出来:#include <iostream>using namespace std;const int SLEN = 30;struct student{ char fullname[SLEN]; char hobby[SLEN]; int ooplevel;};int getinfo(student pa[], ...原创 2020-04-19 16:26:13 · 263 阅读 · 2 评论 -
C++ Primer Plus 第六版课后习题答案(第六章)
C++ Primer Plus 第六版(第六章)的课后习题答案,在main函数中把题号换掉就可以跑不同的程序,第九题的用例在附件中:#include <iostream>#include <fstream>#include <cctype>#include <vector>using namespace std;void p1()...原创 2020-04-06 16:46:32 · 453 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第五章)
把main函数里面的函数名字替换成不同的数字就可以看到不同的题目的效果了。#include <iostream>#include <array>#include <cstring>using namespace std;void p1(){ int low,high; int sum = 0; cout <<...原创 2020-03-18 11:36:01 · 155 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第四章)
最近在读这本C++经典之经典,把一些课后习题发出来给大家参考:#include <iostream>#include <string>#include <cstring>#include <array>using namespace std;void p1(){ char first_name[20],last_name[...原创 2020-03-15 09:24:19 · 249 阅读 · 0 评论 -
C++ Primer Plus 第六版课后习题答案(第三章)
最近在读这本C++经典之经典,把一些课后习题发出来给大家参考:#include <iostream>using namespace std;void p_1(){ int height; const int c = 12; cout << "Enter your height(in):"<<endl; cin >...原创 2020-03-01 17:16:00 · 294 阅读 · 0 评论