Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long int n;
  8. cin>>n;
  9. long int soluong[6];
  10. for(int i=1; i<=5; i++)
  11. soluong[i]=0;
  12. int ID;
  13. for(long int i=0; i<n; i++)
  14. {
  15. cin>>ID;
  16. soluong[ID]++;
  17. }
  18. long int max=soluong[1],tt=1;
  19. for(int i=1; i<=5; i++)
  20. {
  21. if(soluong[i]>max)
  22. {
  23. max=soluong[i];
  24. tt=i;
  25. }
  26. }
  27. cout<<tt;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement