Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- main()
- {
- int N, A[100];
- cin >> N;
- for(int i=0; i<N; i++)
- cin >> A[i];
- cout<<"start"<<endl;
- // da fare
- int B[10] = {0};
- int max = 0;
- for(int j=0;j<N;j++){
- B[A[j]]=B[A[j]] + 1;
- if(B[A[j]] > max)
- max = B[A[j]];
- }
- while (max > 0){
- for(int i=0; i <10; ++i){
- if(B[i] == max){
- cout<<"*";
- B[i]--;
- }
- else
- cout<<" ";
- }
- cout<<endl;
- --max;
- }
- for(int i=0; i<10; i++)
- cout<<i;
- // da fare
- cout<<endl<<"end";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement