ロングヘアセット / paizaOnlineHackathon7
#include <iostream> #include <string> using namespace std; void Solve(void) { string str; int yesCount = 0, noCount = 0; for (int i=0; i<5; ++i) { cin >> str; if (str == "yes") ++yesCount; else if (str == "no") ++noCount; } cout << (yesCount>noCount? "yes" : "no") << endl; } int main(void) { Solve(); return 0; }
yes, noの多い方を出力。
〜了〜