#include<bits/stdc++.h> using namespace std; int main() { int b, m; cin >> b >> m; int n[m]; for (int q = 0 ; q < m ; q++) cin >> n[q]; sort (n , n + m); for (int q = 0 ; q < m ; q++) cout << n[q] << " "; return 0; }
12行搞定。