Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- void rrr( int n)
- {
- int l=0, arr[n], count[1000000];
- for (int i=0; i<n; i++)
- cin >> arr[i];
- for (int i=0; i<1000000; i++)
- count[i]=-1;
- for (int i=0; i<n ; i++)
- count[arr[i]]++;
- for (int i=0; i<1000000 ; ++i)
- for (int j=0; j<=count[i]; ++j)
- {
- arr[l]=i;
- l++;
- }
- for (int i=0; i<n; i++)
- cout << arr[i] << " ";
- }
- int main()
- {
- int a=0;
- cin >> a;
- rrr (a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement