• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. struct name
    5. {
    6. string ten;
    7. int sl;
    8. } typedef name;
    9.  
    10. int main ()
    11. {
    12. name team[3];
    13. for (int i=1; i<=2; i++)
    14. {
    15. team[i].ten="";
    16. team[i].sl=0;
    17. }
    18. int n;
    19. cin>>n;
    20. string tg;
    21. for (int i=1; i<=n; i++)
    22. {
    23. cin>>tg;
    24. if (i==1)
    25. {
    26. team[1].ten=tg;
    27. team[1].sl++;
    28. }
    29. else {
    30. if (tg==team[1].ten) team[1].sl++;
    31. else
    32. {
    33. team[2].ten=tg;
    34. team[2].sl++;
    35. }
    36. }
    37. }
    38. if (team[1].sl>team[2].sl) cout<<team[1].ten;
    39. else if (team[1].sl<team[2].sl) cout<<team[2].ten;
    40. return 0;
    41. }