c函数
Line290
这个作者很懒,什么都没留下…
展开
-
C中字符串转化为实数的一些函数
http://c.biancheng.net/cpp/html/128.html 大致有strtof()、atoi()、atol()、strtod()、strtol()、strtoul()六个; strtod()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,到出现非数字或字符串结束时('\0')才结束转换,并将结果返回。若endptr不为NULL,则会将原创 2016-12-07 01:55:18 · 2117 阅读 · 0 评论 -
堆排序(heap sort)
const int N = 100; int a[N]; int n; void adjust(int low,int high){ for(int i=low;i<=high/2;){ int k=2*i;//k暂存较大的孩子节点的下标 if(2*i+1<=high&&a[2*i]<a[2*i+1]){ k=2*i+1; } if(a[k]>a[i])原创 2017-01-18 15:23:09 · 207 阅读 · 0 评论