Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- long int n;
- cin>>n;
- long int soluong[6];
- for(int i=1; i<=5; i++)
- soluong[i]=0;
- int ID;
- for(long int i=0; i<n; i++)
- {
- cin>>ID;
- soluong[ID]++;
- }
- long int max=soluong[1],tt=1;
- for(int i=1; i<=5; i++)
- {
- if(soluong[i]>max)
- {
- max=soluong[i];
- tt=i;
- }
- }
- cout<<tt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement