自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

菜鸡harry的博客

记录代码 提升自我

  • 博客(18)
  • 收藏
  • 关注

原创 C++ primer plus 第六版 第十六章 编程练习答案

第十六章 编程练习答案这章看的不仔细,第4,10题完全是看网上的额。感觉第一次看不太熟悉,完全不知道说什么,做完题有点明白STL是什么了。1.#include <iostream>#include <string>#include <algorithm>using std::string;bool judge(const string ...

2018-08-31 16:05:12 1398

原创 C++ primer plus 第六版 第十四章 编程练习答案

第十四章 编程练习答案这章看的头有点晕,好多东西都是网上看别人的代码,学的有点模糊1.//头文件,类的声明#ifndef WINE_H_#define WINE_H_#include <iostream>#include <string>#include <valarray>typedef std::valarray<in...

2018-08-27 20:10:34 2816 2

原创 C++ primer plus 第六版 第十三章 编程练习答案

第十三章 编程练习答案1.//头文件#ifndef CD_H_#define CD_H_//Brass Cd 类class Cd{private: char performers[50]; char label[20]; int selections; double playtime;public: Cd(char * s1,...

2018-08-21 15:25:09 3044 7

原创 C++ primer plus 第六版 第十三章 复习题答案

第十三章 复习题答案1.基类的公有成员成为派生类的公有成员。基类的保护成员成为派生类的保护成员。基类的私有成员被基础,但不能直接访问。2.派生类不能继承构造函数,析构函数,赋值运算符和友元。3.若返回类型为void,则只能单个赋值,不能连续赋值。 若返回对象,则速度减慢,因为返回语句需要复制对象。4.按派生的顺序调用构造函数,最早的构造函数最先调用。调...

2018-08-19 18:51:18 998

原创 C++ primer plus 第六版 第十二章 编程练习答案

第十二章 编程练习答案1.//头文件#ifndef COW_H_#define COW_H_class Cow{private: char name[20]; char * hobby; double weight;public: Cow(); Cow(const char * nm, const char * ho, double wt...

2018-08-14 14:58:14 3474 10

原创 C++ pprimer plus 第六版 第十一章 编程练习答案

第十一章 编程练习答案1.//头文件,同11-13不用修改#ifndef VECTOR_H_#define VECTOR_H_#include <iostream>namespace VECTOR{ class Vector { public: enum Mode {RECT, POL};//RECT指平面坐标,PO...

2018-08-11 13:49:54 2021

原创 C++ primer plus 第六版 第十一章 复习题

第十一章 复习题1.Stonewt Stonewt::operator*(double n) const{ Stonewt result; double total = stn * Lbs_per_stn * n +lbs * n; result.stn = total / Lbs_per_stn; result.lbs = total % Lbs...

2018-08-10 09:32:52 1036

原创 C++ primer plus 第六版 第十章 编程练习答案

第十章 编程练习答案1.#ifndef ACCOUNT_H_#define ACCOUNT_H_//头文件class BankAccount{private: std::string fullname; std::string account; double money;public: BankAccount(const std::str...

2018-08-08 13:33:35 4176

原创 c++ primer plus 第六版 第十章 复习题

第十章 复习题1.类是一种将抽象转换为用户定义类型的C++工具,它将数据表示和操纵数据的方法组合成一个整洁的包。——书p342 类声明指定了数据将如何存储,同时指定了用来访问和操纵这些数据的方法(类成员函数)。2.抽象:类表示人们可以类方法的公有接口对类对象执行的操作 封装:将实现细节放在一起并将实现细节与抽象分开 数据隐藏:类的数据成员放在私有部分,只能通过成员函数...

2018-08-07 15:24:42 901

原创 C++ primer plus 第六版 第九章 编程练习答案

第九章 编程练习答案1.//golf.hconst int Len = 40;struct golf{ char fullname[Len]; int handicap;};void setgolf(golf & g, const char * name, int hc);int setgolf(golf & g);void ha...

2018-08-04 16:45:59 2880 4

原创 C++ primer plus 第六版 第八章 编程练习答案

第八章 编程练习答案1.一开始没看懂题目意思,百度参考了一下别人的结果。#include <iostream>using namespace std;int count = 0;void Printf(const char * str, int n = 0);//默认参数 int main(){ const char* str = "hello!"...

2018-08-03 15:19:36 5303 7

原创 C++ primer plus 第六版 第八章 复习题

1.执行时间很短,经常被调用的函数适合作为内联函数。2.//avoid song(const char * name, int times = 1);b.不需要//c.可以,如下void song(const char * name = "O.My Papa", int times = 1);3.void iquote(int n)//int{ ...

2018-07-30 19:00:30 983 1

原创 C++ primer plus 第六版 第六章 编程练习答案

第六章 编程练习答案1.#include<iostream>#include<cctype>int main(){ using namespace std; cout << "Enter text, and type @ to terminate input.\n"; char ch; cin.get(c...

2018-07-30 16:10:00 6391 4

原创 C++ primer plus 第六版 第五章 编程练习答案

第五章 编程练习答案1.#include<iostream>int main(){ using namespace std; int i, a, b, sum; cout << "Enter the smaller number: " ; cin >> a; cout << "Enter...

2018-07-30 15:52:00 2054 4

原创 C++ primer plus 第六版 第四章 编程练习答案

第四章 编程练习答案1.#include<iostream>int main(){ using namespace std; cout << "What is your first name? "; char firstname[20]; cin.getline(firstname, 20);//输入字符串 c...

2018-07-29 23:33:05 779

原创 C++ primer plus 第六版 第三章 编程练习答案

第三章 编程练习答案1.#include<iostream>int main(){ using namespace std; const int factor = 12; cout << "Enter your height in inches: __\b\b"; int a,b,n

2018-07-29 23:07:29 667 2

原创 C++ primer plus 第六版 第二章 编程练习答案

第二章 编程练习答案补发第二章的代码,比较简单,感觉没什么要注释的。后面没写的几章有空接着补。1.#include<iostream>int main(){ using namespace std; cout << "Harry"; cout << endl; cout << "183******...

2018-07-29 14:42:46 1517 4

原创 C++ primer plus 第六版 第七章 编程练习答案

第七章 编程练习答案 1. #include <iostream>using namespace std;double tiaohe (double x, double y);int main() { double

2018-07-28 20:14:29 5024 5

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除