07 2022 档案

摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 17:18 thomas_blog 阅读(212) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 17:01 thomas_blog 阅读(30) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:58 thomas_blog 阅读(84) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:46 thomas_blog 阅读(19) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <numeric> using namespace std; int main() { vector<int> v; for(int i = 0; i <= 100; i++) { v.push_back( 阅读全文
posted @ 2022-07-31 16:42 thomas_blog 阅读(26) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:30 thomas_blog 阅读(39) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:24 thomas_blog 阅读(38) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:16 thomas_blog 阅读(24) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:13 thomas_blog 阅读(22) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:08 thomas_blog 阅读(25) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 16:01 thomas_blog 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 15:49 thomas_blog 阅读(28) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Person { public: Person(string name, int age): name(name), age(a 阅读全文
posted @ 2022-07-31 15:34 thomas_blog 阅读(27) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Person { public: Person(string name, int age): name(name), age(a 阅读全文
posted @ 2022-07-31 13:27 thomas_blog 阅读(42) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 13:21 thomas_blog 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 13:09 thomas_blog 阅读(15) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Person { public: Person(string name, int age): name(name), age(a 阅读全文
posted @ 2022-07-31 12:47 thomas_blog 阅读(44) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Person { public: Person(string name, int age): name(name), age(a 阅读全文
posted @ 2022-07-31 12:34 thomas_blog 阅读(35) 评论(0) 推荐(0) 编辑
摘要:transform(sourceBeg,sourceEnd,destBeg,op) sourceBeg:源容器开始迭代器 sourceEnd:源容器结束迭代器 destBeg:目标容器开始迭代器 op:函数或者函数对象 #include <iostream> #include <vector> #i 阅读全文
posted @ 2022-07-31 11:56 thomas_blog 阅读(44) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; class Print { public: void operator()(bool b) { 阅读全文
posted @ 2022-07-31 11:42 thomas_blog 阅读(14) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; class Print { public: void operator()(int i) { c 阅读全文
posted @ 2022-07-31 11:03 thomas_blog 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <functional> using namespace std; int main() { plus<int> p; cout << p(10, 20) << endl; return 0; } $ ./a.out 30 阅读全文
posted @ 2022-07-31 10:58 thomas_blog 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <functional> using namespace std; int main() { negate<int> n; cout << n(10) << endl; return 0; } $ ./a.out -10 阅读全文
posted @ 2022-07-31 10:55 thomas_blog 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-31 10:45 thomas_blog 阅读(33) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Find { public: bool operator()(int i) { return i < 5; } }; int m 阅读全文
posted @ 2022-07-31 10:28 thomas_blog 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <map> using namespace std; int main() { map<int, string> m; m.insert(pair<int, string>(1, "furong")); m.insert(pair<int, 阅读全文
posted @ 2022-07-30 18:04 thomas_blog 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <set> #include <algorithm> using namespace std; class Person { public: Person(string name, int age): name(name), age(age) 阅读全文
posted @ 2022-07-29 00:01 thomas_blog 阅读(91) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <set> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; cl 阅读全文
posted @ 2022-07-28 23:39 thomas_blog 阅读(45) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main() { pair<string, int> p1("furong", 10); cout << "姓名 " << p1.first << endl; cout << "年龄 " << p1.secon 阅读全文
posted @ 2022-07-28 23:21 thomas_blog 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <set> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; in 阅读全文
posted @ 2022-07-28 18:43 thomas_blog 阅读(15) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <set> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; in 阅读全文
posted @ 2022-07-28 16:34 thomas_blog 阅读(88) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <list> #include <algorithm> using namespace std; template<class T> void myPrint(const T &data) { typena 阅读全文
posted @ 2022-07-27 23:49 thomas_blog 阅读(52) 评论(0) 推荐(0) 编辑
摘要:vector对头部的插入删除效率较低,数据量越大,效率越低 deque相对而言,对头部插入删除速度比vector快 vector访问元素时,比deque快,这和两者内部实现有关 阅读全文
posted @ 2022-07-27 21:32 thomas_blog 阅读(100) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> using namespace std; #define NUM 10000 int main() { vector<int> v; int *p = NULL; int num = 0; for(int i = 0; i 阅读全文
posted @ 2022-07-27 20:43 thomas_blog 阅读(70) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class Print { public: void operator()(int i) { cout << i << endl; } }; 阅读全文
posted @ 2022-07-27 17:45 thomas_blog 阅读(296) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> using namespace std; class OpClass { public: void operator()(int i) { cout << i << endl; } 阅读全文
posted @ 2022-07-27 16:56 thomas_blog 阅读(18) 评论(0) 推荐(0) 编辑
摘要://template.hpp #include <iostream> template<class typeName> class Person { public: Person(typeName name); void show(); protected: typeName m_name; }; 阅读全文
posted @ 2022-07-22 08:14 thomas_blog 阅读(65) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class typeName> class Person { public: Person(typeName name); void show(); protected: typeName m_name; }; template<class 阅读全文
posted @ 2022-07-21 08:19 thomas_blog 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <typeinfo> template<class typeName> class Person { public: Person() { std::cout << "typeName数据类型 " << typeid(typeName).na 阅读全文
posted @ 2022-07-21 07:53 thomas_blog 阅读(28) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class typeName, class typeAge = int> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} v 阅读全文
posted @ 2022-07-17 23:14 thomas_blog 阅读(14) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class typeName, class typeAge> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} void sh 阅读全文
posted @ 2022-07-17 23:11 thomas_blog 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class typeName, class typeAge> class Person { public: Person(typeName name, typeAge age): name(name), age(age) {} void sh 阅读全文
posted @ 2022-07-15 14:00 thomas_blog 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<class T> bool compare(T &a, T &b) { return (a == b); } class Person { public: Person(std::string name, int age): name(nam 阅读全文
posted @ 2022-07-13 14:30 thomas_blog 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> /* 函数模板和普通函数都实现 优先调用普通函数 */ void myswap(int &a, int &b) { std::cout << "myswap" << std::endl; int tmp = a; a = b; b = tmp; } templ 阅读全文
posted @ 2022-07-13 13:31 thomas_blog 阅读(100) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> template<typename T> void myswap(T &a, T &b) { T tmp = a; a = b; b = tmp; } int main() { using namespace std; int a = 1; int b = 2 阅读全文
posted @ 2022-07-13 12:44 thomas_blog 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <fstream> int main() { using namespace std; ifstream ifs; ifs.open("test.txt", ios::in); if(!ifs.is_open()) { cout << "op 阅读全文
posted @ 2022-07-12 16:58 thomas_blog 阅读(20) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <fstream> int main() { using namespace std; ofstream ofs; ofs.open("test.txt", ios::out); ofs << "hello furong" << endl; 阅读全文
posted @ 2022-07-12 15:11 thomas_blog 阅读(23) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: Person() { std::cout << "Person" << std::endl; } virtual ~Person() = 0; public: }; Person::~Person() { std: 阅读全文
posted @ 2022-07-11 15:46 thomas_blog 阅读(105) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: Person() { std::cout << "Person" << std::endl; } ~Person() { std::cout << "~Person" << std::endl; } public: 阅读全文
posted @ 2022-07-11 14:59 thomas_blog 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Animal { public: virtual void talk() { std::cout << "Animal talk" << std::endl; } }; class Dog: public Animal { public: void 阅读全文
posted @ 2022-07-06 19:05 thomas_blog 阅读(19) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: static int age; }; class Student: public Person { public: static int age; int grade; }; int Person::age = 5 阅读全文
posted @ 2022-07-06 17:32 thomas_blog 阅读(16) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示