Advertisement
Josif_tepe

Untitled

Apr 21st, 2024
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     vector<int> v(n);
  9.     vector<int> cnt(105, 0);
  10.     for(int i = 0; i < n; i++) {
  11.         cin >> v[i];
  12.         cnt[v[i]]++;
  13.     }
  14.    
  15.     for(int i = 0; i <= 100; i++) {
  16.         for(int j = 0; j < cnt[i]; j++) {
  17.             cout << i << " ";
  18.         }
  19.     }
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement