Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- long long int n, x;
- cin >> n;
- long long int* a = new long long int[n];
- int* b = new int[10];
- int* c = new int[n];
- for (auto i = 0; i < 10; ++i)
- b[i] = 0;
- for (int i = 0; i < n; ++i)
- {
- cin >> x;
- a[i] = x;
- b[x]++;
- }
- for (int i = 0; i < n; ++i)
- {
- c[i] = a[n - 1 - i];
- }
- for (int i = 0; i < 10; ++i)
- cout << b[i] << " ";
- cout << endl;
- for (int i = 0; i < n; ++i)
- {
- cout << c[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement