• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. int main ()
    5. {
    6. //IN;
    7. string vote;
    8. while (1)
    9. {
    10. cin>>vote;
    11. if (vote=="#") break;
    12. //OUT;
    13. int len=vote.length();
    14. int countY=0;
    15. int countN=0;
    16. int countP=0;
    17. int countA=0;
    18. for (int i=0; i<len; i++)
    19. {
    20. if (vote[i]=='Y') countY++;
    21. if (vote[i]=='N') countN++;
    22. if (vote[i]=='P') countP++;
    23. if (vote[i]=='A') countA++;
    24. }
    25. if ((float)countA>=(float)len/2.0) cout<<"need quorum"<<endl;
    26. else
    27. {
    28. if (countY>countN) cout<<"yes"<<endl;
    29. else if (countN>countY) cout<<"no"<<endl;
    30. else cout<<"tie"<<endl;
    31. }
    32. }
    33. return 0;
    34. }