随笔分类 -  学习C++

记录c++学习过程
摘要:1 // chapter18.h 2 3 #ifndef LEARN_CPP_CHAPTER18_H 4 #define LEARN_CPP_CHAPTER18_H 5 6 #include <iostream> 7 #include <initializer_list> 8 9 template< 阅读全文
posted @ 2022-01-14 21:07 开心果壳好硬 阅读(143) 评论(0) 推荐(0)
摘要:1 // chapter17.h 2 3 #ifndef LEARN_CPP_CHAPTER17_H 4 #define LEARN_CPP_CHAPTER17_H 5 6 #include <iostream> 7 #include <fstream> 8 #include <vector> 9 阅读全文
posted @ 2021-12-07 21:48 开心果壳好硬 阅读(195) 评论(0) 推荐(0)
摘要:1 // chapter16.h 2 3 4 #ifndef LEARN_CPP_CHAPTER16_H 5 #define LEARN_CPP_CHAPTER16_H 6 7 #include <iostream> 8 #include <string> 9 #include <cctype> 1 阅读全文
posted @ 2021-11-08 15:30 开心果壳好硬 阅读(245) 评论(0) 推荐(0)
摘要:1 // chapter15_1_tvremote.h 2 3 #ifndef LEARN_CPP_CHAPTER15_1_TVREMOTE_H 4 #define LEARN_CPP_CHAPTER15_1_TVREMOTE_H 5 class Remote; 6 class Tv { 7 pri 阅读全文
posted @ 2021-10-22 17:35 开心果壳好硬 阅读(214) 评论(0) 推荐(0)
摘要:1 // chapter14_1_wine.h 2 3 #ifndef LEARN_CPP_CHAPTER14_1_WINE_H 4 #define LEARN_CPP_CHAPTER14_1_WINE_H 5 6 #include <valarray> 7 #include <string> 8 阅读全文
posted @ 2021-10-16 18:01 开心果壳好硬 阅读(321) 评论(0) 推荐(0)
摘要:1 // chatper13_1_cd.h 2 3 #ifndef LEARN_CPP_CHAPTER13_1_CD_H 4 #define LEARN_CPP_CHAPTER13_1_CD_H 5 6 7 class Cd { 8 private: 9 char performers[50]; 1 阅读全文
posted @ 2021-10-04 20:57 开心果壳好硬 阅读(263) 评论(0) 推荐(0)
摘要:1 // chapter12_1_cow.h 2 3 4 #ifndef LEARN_CPP_CHAPTER12_1_COW_H 5 #define LEARN_CPP_CHAPTER12_1_COW_H 6 7 class Cow { 8 private: 9 char name_[20]; 10 阅读全文
posted @ 2021-09-26 13:55 开心果壳好硬 阅读(208) 评论(0) 推荐(0)
摘要:最近开学,事情较多,过两天更新。。。 阅读全文
posted @ 2021-09-24 21:49 开心果壳好硬 阅读(63) 评论(0) 推荐(0)
摘要:1 // chapter10_1_account.h 2 3 #ifndef LEARN_CPP_CHAPTER10_1_ACCOUNT_H 4 #define LEARN_CPP_CHAPTER10_1_ACCOUNT_H 5 6 #include <iostream> 7 #include <s 阅读全文
posted @ 2021-09-08 21:01 开心果壳好硬 阅读(211) 评论(0) 推荐(0)
摘要:1 // chapter09_golf.h 2 3 #ifndef LEARN_CPP_CHAPTER09_GOLF_H 4 #define LEARN_CPP_CHAPTER09_GOLF_H 5 6 #include <cstring> 7 #include <iostream> 8 9 con 阅读全文
posted @ 2021-09-04 15:07 开心果壳好硬 阅读(202) 评论(0) 推荐(0)
摘要:1 void ch8_1_print(const std::string & str, int n = 0 ) { 2 using namespace std; 3 static int flag = 0; 4 ++ flag; 5 if (!n) 6 cout << str << endl; 7 阅读全文
posted @ 2021-09-01 17:18 开心果壳好硬 阅读(227) 评论(0) 推荐(0)
摘要:1 double ch7_1_harmonicaverage(double a, double b) { 2 return 2 / (1 / a + 1 / b); 3 } 4 5 void ch7_1() { 6 using namespace std; 7 double a{0}, b{0}; 阅读全文
posted @ 2021-08-30 13:51 开心果壳好硬 阅读(181) 评论(0) 推荐(0)
摘要:1 void ch6_1() { 2 using namespace std; 3 char ch; 4 while ((ch = cin.get()) != '@') { 5 if (isdigit(ch)) 6 continue; 7 else if (islower(ch)) 8 ch = t 阅读全文
posted @ 2021-08-29 14:34 开心果壳好硬 阅读(187) 评论(0) 推荐(0)
摘要:1 void ch5_1() { 2 using namespace std; 3 int small, big, sum{0}; 4 cout << "enter small and big: " << endl; 5 cout << "small: "; cin >> small; 6 cout 阅读全文
posted @ 2021-08-28 15:25 开心果壳好硬 阅读(156) 评论(0) 推荐(0)
摘要:1 void ch4_1() { 2 using namespace std; 3 string fname, lname; 4 char grade; 5 unsigned int age; 6 cout << "enter first name: "; 7 getline(cin, fname) 阅读全文
posted @ 2021-08-27 14:33 开心果壳好硬 阅读(181) 评论(0) 推荐(0)
摘要:1 void ch3_1() { 2 using namespace std; 3 unsigned int factor = 12; 4 unsigned int inch, feet; 5 cout << "enter your height in inch:______\b\b\b\b\b\b 阅读全文
posted @ 2021-08-25 11:33 开心果壳好硬 阅读(137) 评论(0) 推荐(0)
摘要:1 void ch2_1() { 2 using namespace std; 3 cout << "xxxxxxxx" << endl; 4 } 5 6 void ch2_2() { 7 using namespace std; 8 double num; 9 cout << "please in 阅读全文
posted @ 2021-08-24 18:54 开心果壳好硬 阅读(169) 评论(0) 推荐(0)