
acm
arcobaleno1996
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数组的初始化
数组初始化列表中的元素个数小于指定的数组长度时,不足的元素补以默认值。 int degree[100] = {2};//只有第一个数被初始化为2,其余还是默认值0. int degree[100] = {1, 2};//第一个数为1,第二个数为2. 等号可以省略 所以用memset进行初始化: #include <cstring> memset(str,'a',sizeof...原创 2018-08-04 09:55:54 · 278 阅读 · 0 评论 -
c++强制类型转换
C++中若需要将string类型转为int类型,需先将string转为const char* #include<string> #include <stdlib.h> int a= atoi(b.c_str());原创 2018-08-05 10:33:59 · 154 阅读 · 0 评论 -
sort函数
1、sort函数可以三个参数也可以两个参数,必须的头文件#include < algorithm>和using namespace std; 2、它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) 3、Sort函数有三个参数:(第三个参数可不写) (1)第一个是要排序的数组的起始地址。 (2)第二个是结束的地址(最后一位要排序的地址) (3)第三个参数是排序的...原创 2018-08-08 16:16:41 · 11044 阅读 · 0 评论