Naxocist

Runner

Mar 30th, 2022
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define endll '\n'
  3. using namespace std;
  4.  
  5.  
  6. int c[5];
  7. int main() {
  8.     ios_base::sync_with_stdio(0); cin.tie(0);
  9.     int n; cin >> n;
  10.  
  11.     for(int i=0; i<n; ++i){
  12.         int x; cin >> x;
  13.         c[x]++;
  14.     }
  15.  
  16.     for(int i=0; i<5; ++i){
  17.         for(int j=0; j<c[i]; ++j) cout << i << ' ';
  18.     }
  19.  
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment