Advertisement
OMEGAHEAD_MonkoX

Untitled

Nov 19th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6. long long int n, x;
  7. cin >> n;
  8. long long int* a = new long long int[n];
  9. int* b = new int[10];
  10. int* c = new int[n];
  11. for (auto i = 0; i < 10; ++i)
  12. b[i] = 0;
  13. for (int i = 0; i < n; ++i)
  14. {
  15. cin >> x;
  16. a[i] = x;
  17. b[x]++;
  18. }
  19. for (int i = 0; i < n; ++i)
  20. {
  21. c[i] = a[n - 1 - i];
  22. }
  23. for (int i = 0; i < 10; ++i)
  24. cout << b[i] << " ";
  25. cout << endl;
  26. for (int i = 0; i < n; ++i)
  27. {
  28. cout << c[i] << " ";
  29. }
  30.  
  31.  
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement