c++自动比较数字大小函数

来源:互联网 发布:买网络电视要注意什么 编辑:程序博客网 时间:2024/06/07 10:42

sort(begin,end)函数可用于c++中自动进行排序

头文件: #include <algorithm>

使用方法:

int main(){

int a[5]={3,8,5,1,9};

sort(a,a+5);

for(int i=0;i<5;i++){

cout<<a[i];

}


}

1 0
原创粉丝点击