- 博客(6)
- 收藏
- 关注
原创 c++ Primer Plus 第十一章 答案
第1题 头文件和函数定义和原文相同 vector.h #ifndef VECTOR_H_ #define VECTOR_H_ #include <iostream> namespace VECTOR { class Vector { public: enum Mode { RECT, POL }; private: double x; double y; double mag; double ang; Mode mode; void set_mag();
2020-12-02 00:12:33
319
原创 c++ Primer Plus 第十章 答案
第1题 bankaccount.h //bankaccount.h #ifndef BANKACCOUNT_H_ #define BANKACCOUNT_H_ class Bankaccount { private: std::string m_name; std::string m_account; double m_money; public: Bankaccount(); Bankaccount(const std::string& name, const std::strin
2020-11-25 21:55:30
438
原创 c++ Primer Plus 第九章 答案
第1题: golf.h //golf.h #ifndef GOLF_H_ #define GOLF_H_ const int Len = 4; struct golf { char fullname[Len]; int handicap; }; void setgolf(golf& g, const char* name, int hc); int setgolf(golf& g); void handicap(golf& g, int hc); void showg
2020-11-05 22:49:21
510
原创 c++ Primer Plus 第八章 答案
1、 #include <iostream> using namespace std; void show(const char* str, int n = 0); int main() { char c[40] = "shixiaochuan"; cout << "First time:\n"; show(c); cout << "First time:\n"; show(c, 1); cout << "Second times:\n";
2020-10-25 00:45:54
287
原创 c++ Primer Plus 第七章 答案
第1题 #include <iostream> using namespace std; double harmean_result(double x, double y); int main() { cout << "Input two numbers (0 to quit): "; double x, y; while (cin >> x >> y && x != 0 && y != 0) { cout <
2020-10-19 14:31:08
274
原创 c++ Primer Plus 第六章 答案
第1题 #include <iostream> #include <cctype> using namespace std; int main() { char ch; cout << "Enter something: "; while (cin.get(ch) && ch != '@') { if (!isdigit(ch)) { if (isalpha(ch)) { if (isupper(ch)) {
2020-09-29 00:56:40
176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅