- 博客(24)
- 收藏
- 关注
原创 C++ primer plus 第六版第13章编程练习答案(1-3题)
1.//head#ifndef C__13_1_hpp#define C__13_1_hppclass Cd{private: char performers[50]; char label[20]; int selections; double playtime;public: Cd(const char * s1="blank",const char * s2="blank",int n=0,double x=0.0); Cd(const
2020-06-12 00:32:57 223
原创 C++ primer plus第六版第12章编程题答案(全)
1.//头文件#ifndef C__12_hpp#define C__12_hpp#include <cstring>class Cow{private: char name[20]; char * hobby; double weight;public: Cow(); Cow(const char * num,const char * ho,double wt); Cow(const Cow & c); ~Cow(
2020-06-09 00:13:40 343 1
原创 C++ primer plus 第6版第11章编程练习答案(全)
1.//头文件#ifndef C__11_hpp#define C__11_hpp#include <iostream>namespace VECTOR { class Vector { public: enum Mode{RECT,POL}; private: double x; double y; double mag; double ang; M
2020-06-02 16:02:55 489
原创 C++ Primer plus 第6版 第10章编程答案
10.1//header file#ifndef C__10_hpp#define C__10_hpp#include <stdio.h>#include <string>class Bank{private: std::string name; std::string num; double balance;public: Bank(const std::string & str,const std::string &am
2020-05-20 23:42:31 298
原创 C++ primer plus 第6版 第9章编程答案
9-1.//main.cpp#include <iostream>#include "golf.hpp"int main(void) { golf ann; setgolf(ann,"Ann Birdfree",24); showgolf(ann); golf ann1[3]; int i=0; while(i<3 &&setgolf(ann1[i])) ++i; for(int k=0;k&l
2020-05-13 23:37:55 171
原创 C++ Primer Plus 第6版第8章编程练习答案
8-1#include <iostream>void play(char *ptr,int);void play(char *ptr);int k=1;//external variable;int main() { using namespace std; cout<<"Enter a string:"<<endl; char...
2020-05-05 21:26:40 329
原创 C++primer plus 6th 第7章7.10编程答案
#include <iostream>double calculate(double a,double b,double (*ptr)(double a,double b));double add(double a,double b);double div(double a,double b);int main() { using namespace std; ...
2020-05-01 18:41:28 161
原创 C++primer plus 6th 第7章7.9编程答案
#include <iostream>using namespace std;const int SLEN = 30;struct student{ char fullname[SLEN]; char hobby[SLEN]; int ooplevel;};int getinfo(student pa[],int n);void display1(s...
2020-05-01 18:37:45 131
原创 C++primer plus 6th 第7章7.8b编程答案
#include <iostream>using namespace std;const int seasons=4;const char *snames[seasons]={ "Spring","Summer","Fall","Winter"};struct expenses{ double expen[4]; };void fill(expe...
2020-05-01 18:36:48 186
原创 C++primer plus 6th 第7章7.8编程答案
#include <iostream>#include <string>using namespace std;const int seasons=4;const char *snames[seasons]={ "Spring","Summer","Fall","Winter"};void fill(double *ar);void show(doub...
2020-05-01 18:35:41 111
原创 C++primer plus 6th 第7章7.7编程答案
#include <iostream>using namespace std;double * fill_array(double * ar,double * br);void show_array(const double *ar,double *br);void revalue (double r,double * ar,double *br);const int si...
2020-05-01 18:34:49 173
原创 C++primer plus 6th 第7章7.6编程答案
#include <iostream>using namespace std;int Fill_array(float ar[],int n);void Show_array(float ar[],int n);void Reverse_array(float ar[],int n);int main() { float arr[5]; int n=Fill_...
2020-05-01 18:33:54 106
原创 C++primer plus 6th 第7章7.5编程答案
#include <iostream>using namespace std;long factorial(int a);int main() { int m; cout<<"Input a number:(q to quit)"; while(cin>>m) { cout<<m<<"...
2020-05-01 18:33:11 143
原创 C++primer plus 6th 第7章7.4编程答案
#include <iostream>using namespace std;long double probability(int range,int choice);int main() { int range1,choice1,range2,choice2; cout<<"Please input first range , choice ,\n...
2020-05-01 18:32:19 120
原创 C++primer plus 6th 第7章7.3编程答案
#include <iostream>using namespace std;struct box{ char maker[40]; float height; float width; float length; float volume;};void func1(box a);void func2(box * ar);int m...
2020-05-01 18:31:11 159
原创 C++primer plus 6th 第7章7.2编程答案
#include <iostream>using namespace std;int input(float ar [],int n);void show(float ar[],int n);float aver(float ar[],int n);int main() { float score[10]; int m=input(score,10); ...
2020-05-01 18:29:28 162
原创 C++primer plus 6th 第7章7.1编程答案
#include <iostream>double harmonic(float a,float b);int main() { using namespace std; float a,b; cout<<"Please input two numbers:"; while(cin>>a>>b&&a...
2020-05-01 18:22:55 204
原创 C++ primer plus 6th 第六章6.7 编程答案
#include <iostream>#include <cctype>#include <cstring>int main() { using namespace std; char ch[10];// insert code here... int n_vo=0; int n_con=0; int n_other...
2020-04-22 16:56:25 136
原创 C++ primer plus 6th 第六章6.6 编程参考答案
#include <iostream>#include <string>#include <vector>using namespace std;struct donor{ string name; double money;};int main() { int n; cout<<"Enter the nu...
2020-04-21 22:51:08 262
原创 C++ primer plus 6th 第六章6.5编程题参考答案
#include <iostream>const float class1=5000;const float class2=10000;const float class3=20000;const float tax1=0;const float tax2=0.1;const float tax3=0.15;const float tax4=0.2;int main(...
2020-04-21 21:41:49 242
原创 C++ primer plus 6th 6.4编程答案(仅供参考)
#include <iostream>#include <cstring>void menu(void);const int strsize=20;using namespace std;struct bop{ char fullname[strsize]; char title[strsize]; char bopname[strsize...
2020-04-21 21:09:13 220
原创 C++ primer plus 6th 6.2答案
#include <iostream>#include <array>int main() { using namespace std; cout<<"Enter 10 donation value(non-numeric to quit):"<<endl; array<float,10> ar; in...
2020-04-21 14:51:46 146
原创 C++ primer plus 6th 6.3答案
#include <iostream>using namespace std;void menu(void);int main() { char ch; menu(); A: cin.get(ch).get(); switch(ch) { case 'c':cout<<"Tigger is a carnivore....
2020-04-21 14:50:06 111
原创 C Primer plus 6th 第12章9题参考答案
#include <stdio.h>#include <string.h>#include <stdlib.h>#define W_SIZE 15int main(){ char (*pl)[W_SIZE]; int words; int i=0; int k; printf("How many words do...
2020-03-28 23:22:44 178
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人