摘要:
#include <iostream>#include <algorithm>#include <vector>#include <list>#include <string>#include <functional>#include<iterator> using namespace std; i
阅读全文
posted @ 2019-06-12 16:08
西北逍遥
阅读(206)
推荐(0)
摘要:
#include <iostream>#include <vector>#include <deque>#include <algorithm> using namespace std; int main(){ vector<int> vec1; deque<int> deq1; for (int
阅读全文
posted @ 2019-06-12 12:44
西北逍遥
阅读(338)
推荐(0)
摘要:
#include<iostream>#include<vector>#include <list>#include <algorithm>#include <functional> using namespace std; //不需拷贝,速度快void square(int &elementPara
阅读全文
posted @ 2019-06-12 10:44
西北逍遥
阅读(302)
推荐(0)
摘要:
list<char>::iterator pos; 一般使用前置式递增(preincrement),因为它比后置式递增(postincrement)效率高,因为后置式递增内部需要一个临时对象,因为它必须存放迭代器原来的位置并返回之。
阅读全文
posted @ 2019-06-12 10:22
西北逍遥
阅读(738)
推荐(0)
摘要:
#include<iostream>#include<vector>#include <list>#include <algorithm>#include <functional> using namespace std; int main(){ vector<int> vec1; list<int
阅读全文
posted @ 2019-06-12 09:52
西北逍遥
阅读(439)
推荐(0)
摘要:
#include <iostream>#include <algorithm>#include <vector>#include <functional>#include <list> using namespace std; int main(){ list<int> list1; for (in
阅读全文
posted @ 2019-06-12 08:24
西北逍遥
阅读(361)
推荐(0)
摘要:
#include <iostream>#include <algorithm>#include <list>#include <functional>#include <vector> using namespace std; //已序区间查找int main(){ list<int> list1;
阅读全文
posted @ 2019-06-11 19:08
西北逍遥
阅读(760)
推荐(0)
摘要:
#include <iostream>#include <algorithm>#include <deque>#include <list>#include <vector>#include <functional> using namespace std; //二元谓词bool isEven(in
阅读全文
posted @ 2019-06-11 16:33
西北逍遥
阅读(661)
推荐(0)
摘要:
#include <iostream>#include <list>#include <algorithm> using namespace std; int main(){ list<int> list1; for (int k=0;k<10;k++) { list1.push_back(k);
阅读全文
posted @ 2019-06-11 15:13
西北逍遥
阅读(7775)
推荐(0)
摘要:
#include <iostream>#include <algorithm>#include <deque> using namespace std; //二元谓词//比较两个数的大小bool absLess(int elementParam1,int elementParam2){ return
阅读全文
posted @ 2019-06-10 20:45
西北逍遥
阅读(3331)
推荐(0)
摘要:
#include <iostream>#include <algorithm>#include <vector>#include <functional>#include<set> using namespace std; //一元谓词bool isEven(int elementParam){ i
阅读全文
posted @ 2019-06-10 20:25
西北逍遥
阅读(1297)
推荐(0)
摘要:
#include <iostream>#include <set> using namespace std; template<typename Container>void PrintContents(const Container& con); template<typename Contain
阅读全文
posted @ 2019-06-10 15:00
西北逍遥
阅读(170)
推荐(0)
摘要:
template<typename Container>void PrintContents(const Container& con) { Container::const_iterator iter = con.begin(); while (iter != con.end()) { cout
阅读全文
posted @ 2019-06-10 14:40
西北逍遥
阅读(353)
推荐(0)
摘要:
#include <iostream>#include <map>#include <string> using namespace std; int main(){ map<int, string> map1; multimap<int, string> multimap1; map1.inser
阅读全文
posted @ 2019-06-10 10:15
西北逍遥
阅读(1636)
推荐(0)
摘要:
#include <iostream>#include <string> using namespace std; int main(){ string str1("hello"); string str2("hello"); string str3("world"); if (str1 != st
阅读全文
posted @ 2019-06-10 09:20
西北逍遥
阅读(2773)
推荐(0)
摘要:
#include <iostream>#include <string> using namespace std; int main(){ string str1("hello"); string str2(" study c++"); string::iterator str_iter = str
阅读全文
posted @ 2019-06-09 20:08
西北逍遥
阅读(890)
推荐(0)
摘要:
#include <iostream>#include <string> using namespace std; int main(){ string a1; cout << a1<< endl; string s2(5,'a'); cout << s2 << endl; string s3(s2
阅读全文
posted @ 2019-06-09 19:42
西北逍遥
阅读(1635)
推荐(0)
摘要:
#include <iostream>#include <vector> using namespace std; int main(){ vector<int> vec1; for (int k=0;k<20;k++) { vec1.push_back(k); cout << "size:"<<v
阅读全文
posted @ 2019-06-09 17:14
西北逍遥
阅读(387)
推荐(0)
摘要:
#include <iostream>#include <vector>#include <list>#include <deque> using namespace std; int main(){ vector<int> a; vector<int> b; a.push_back(10); a.
阅读全文
posted @ 2019-06-09 16:14
西北逍遥
阅读(763)
推荐(0)
摘要:
#include <iostream>#include <list>#include <algorithm>#include <string> using namespace std; int main(){ list<string> slist; slist.push_back("A"); sli
阅读全文
posted @ 2019-06-09 15:49
西北逍遥
阅读(312)
推荐(0)
posted @ 2019-06-08 21:03
西北逍遥
阅读(353)
推荐(0)
摘要:
#pragma oncetemplate<typename T>class smart_pointer{private: T* m_pRawPointer;public: smart_pointer(T* pData) :m_pRawPointer(pData) {} //复制构造函数 smart_
阅读全文
posted @ 2019-06-08 20:16
西北逍遥
阅读(160)
推荐(0)
摘要:
try { for (int i = 0; i<1000; i++) { test1 = new Test(); cout << i << " new dog success..." << endl; } } catch (bad_alloc err) { cout << "fail:"<<err.
阅读全文
posted @ 2019-06-08 19:22
西北逍遥
阅读(534)
推荐(0)
摘要:
#include <iostream> using namespace std; const int DefaultSize = 10; class Array{public: Array(int itsSize=DefaultSize); ~Array() { delete[] pType; }
阅读全文
posted @ 2019-06-08 17:34
西北逍遥
阅读(881)
推荐(0)
摘要:
#include <iostream>#include <stdio.h> using namespace std; class IOException{};class FileException{};class UndefineError{}; void my_copy(const char* s
阅读全文
posted @ 2019-06-08 16:54
西北逍遥
阅读(1609)
推荐(0)
摘要:
#include <iostream>#include <stdio.h> using namespace std; void my_copy(const char* src_file, const char* dest_file){ FILE *in_file, *out_file; in_fil
阅读全文
posted @ 2019-06-08 16:42
西北逍遥
阅读(1925)
推荐(0)
摘要:
#include <iostream>#include <stdio.h> using namespace std; int my_copy(const char* src_file,const char* dest_file){ FILE *in_file, *out_file; in_file
阅读全文
posted @ 2019-06-08 16:37
西北逍遥
阅读(375)
推荐(0)
摘要:
template<class T> void Queue<T>::Push(const T& item){ /*if (rear == capacity-1) { rear = 0; } else { rear++; }*/ //判断队列是否存满 if ((rear+1)%capacity == f
阅读全文
posted @ 2019-06-07 21:29
西北逍遥
阅读(532)
推荐(0)
摘要:
package com.bim.rrt_20190529; import static java.lang.Math.pow;import static java.lang.Math.sqrt; import java.util.ArrayList; public class Tree { Node
阅读全文
posted @ 2019-06-07 13:10
西北逍遥
阅读(176)
推荐(0)
摘要:
#include<iostream>#include<algorithm>#include<vector>using namespace std; int main(){ vector<int> v1; for(int i=0;i<10;++i) { v1.push_back(i); } for_e
阅读全文
posted @ 2019-06-06 08:55
西北逍遥
阅读(305)
推荐(0)