题解 | #排序#
排序
https://www.nowcoder.com/practice/508f66c6c93d4191ab25151066cb50ef
#include "bits/stdc++.h" using namespace std; bool cmp(int a,int b){ return a<b; } int main() { int n; int array[100000]={0}; scanf("%d",&n); for (int i = 0; i < n; ++i) { scanf("%d",&array[i]); } sort(array,array+n,cmp); for (int i = 0; i < n; ++i) { printf("%d ",array[i]); } }