fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_FR = 501;
  5. const int MAX_SIZE = 100000;
  6.  
  7. int main() {
  8. int n, v[MAX_SIZE + 1], fr[MAX_FR];
  9. cin >> n;
  10. for (int i = 0; i < MAX_FR; ++i) {
  11. fr[i] = 0;
  12. }
  13. for (int i = 1; i <= n; ++i) {
  14. cin >> v[i];
  15. ++fr[v[i]];
  16. }
  17. for (int i = 0; i < MAX_FR; ++i) {
  18. for (int j = 1; j <= fr[i]; ++j) {
  19. cout << i << ' ';
  20. }
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty