2018年12月24日
摘要: 1 #include 2 using namespace std; 3 #include 4 5 void printVector(vector& v) { 6 for (vector::iterator it = v.begin(); it != v.end(); it++) { 7 cout v1;//默认构造 初始化 15 ... 阅读全文
posted @ 2018-12-24 18:44 likeghee 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #include 4 5 6 //初始化操作 7 void test01() { 8 //初始化操作 9 string s1; 10 string s2(10, 'a'); 11 string s3("abc"); 12 string ... 阅读全文
posted @ 2018-12-24 16:46 likeghee 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #include //动态数组 4 #include //算法 5 6 void PrintVector(int v) { 7 cout v; //定义一个容器 指定存放的元素类型 18 v.push_back(10); //把元素放入容器尾部 19 v.push_back(3... 阅读全文
posted @ 2018-12-24 16:45 likeghee 阅读(159) 评论(0) 推荐(0) 编辑