STL
ylemfei
这个作者很懒,什么都没留下…
展开
-
STL sort用法
只讨论sort简单使用方法 demo1 #include<iostream> #include<algorithm> #include<vector> using namespace std; int main() { int a[] = {2, 5, 3, 4, 1}; sort(a, a + 5); for(int i = 0; i < 5; i原创 2019-01-04 11:33:24 · 1220 阅读 · 0 评论 -
STL map的基本用法
map容器 **<键,值>**对 键值不允许重复。 如果map中没有键值,而直接插入,则操作是允许的;另外如果直接使用“++”运算符,则从0开始直接计数。并把这个<键,值>对插入到map中。 常用函数和操作 1.map的创建、插入和遍历 #include<map> #include<iostream> #include<str...原创 2019-01-07 16:58:31 · 3145 阅读 · 0 评论