Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. main()
  4. {
  5. int N, A[100];
  6. cin >> N;
  7. for(int i=0; i<N; i++)
  8. cin >> A[i];
  9. cout<<"start"<<endl;
  10. // da fare
  11. int B[10] = {0};
  12. int max = 0;
  13. for(int j=0;j<N;j++){
  14. B[A[j]]=B[A[j]] + 1;
  15. if(B[A[j]] > max)
  16. max = B[A[j]];
  17. }
  18. while (max > 0){
  19. for(int i=0; i <10; ++i){
  20. if(B[i] == max){
  21. cout<<"*";
  22. B[i]--;
  23. }
  24. else
  25. cout<<" ";
  26. }
  27. cout<<endl;
  28. --max;
  29. }
  30. for(int i=0; i<10; i++)
  31. cout<<i;
  32. // da fare
  33. cout<<endl<<"end";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement