#include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int MAX_NUM = 100; /** * 排序--华中科技大学 * * @return */ int main() { int n; cin >> n; int num[MAX_NUM]; for (int i = 0; i < n; ++i) { cin >> num[i]; } /** * sort(first, last, comp)函数有三个参数: * first:待排序序列的起始地址 * last:待排序序列的结束地址(不包含结束地址,即开区间) * comp:为排序方式,不填写时默认为升序方式。 */ sort(num, num + n); for (int j = 0; j < n; ++j) { cout << num[j] << " "; } cout << endl; return 0; }