12 2019 档案

摘要:1 #include<iostream> 2 using namespace std; 3 int n; 4 void print(int *a) 5 { 6 for(int i=0;i<n;i++) 7 { 8 cout<<a[i]<<" "; 9 } 10 cout<<endl; 11 } 12 阅读全文
posted @ 2019-12-19 10:02 念秋 阅读(530) 评论(0) 推荐(0) 编辑
摘要:map左边只有结构体指针时,地址分配由创建顺序由大到小,map左边排序按照指针地址数值大小由大到小进行排序,不同于平时的由小到大。 1 #include<iostream> 2 #include<map> 3 using namespace std; 4 typedef struct tree* T 阅读全文
posted @ 2019-12-17 15:28 念秋 阅读(386) 评论(0) 推荐(0) 编辑
摘要:/* auto赋值只是暂时有效,iterator赋值才是真实有效地*/ /* 不只是vector,所有能用迭代器的容器应该都具有这个特点*/ 1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 int main() 5 { 阅读全文
posted @ 2019-12-14 10:23 念秋 阅读(1129) 评论(2) 推荐(1) 编辑