题解 | #排序#
排序
https://www.nowcoder.com/practice/508f66c6c93d4191ab25151066cb50ef
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main(){ int n; while(scanf("%d",&n) != EOF){ int list[n]; for (int i =0 ;i<n;i++){ int m; scanf("%d",&m); list[i]=m; } sort(list,list+n); for (int i=0;i<n;i++) { printf("%d ", list[i]); } } }