摘要: sort()函数是C++中的排序函数其头文件为:#include<algorithm>头文件;qsort()是C中的排序函数,其头文件为:#include<stdlib.h>1、sort()sort对给定区间所有元素进行排序stable_sort对给定区间所有元素进行稳定排序partial_sort对给定区间所有元素部分排序partial_sort_copy对给定区间复制并排序nth_element找出给定区间的某个位置对应的元素is_sorted判断一个区间是否已经排好序partition使得符合某个条件的元素放在前面stable_partition相对稳定的使得符合 阅读全文
posted @ 2013-03-11 23:58 Mr.Shadow 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Folks often see output statements like the two below, and then want to know what the difference is:#include <iostream>int main(){int i = 99;std::cout << i << '\n'; // Astd::cout << i << std::endl; // Breturn 0;}In short, using'\n'is a request to output a 阅读全文
posted @ 2013-03-11 23:32 Mr.Shadow 阅读(240) 评论(0) 推荐(0) 编辑