Card Game
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0060
解法:普通にそのまま
#include<iostream> #include<string> #include<map> using namespace std; int main() { int c1,c2,c3; while (cin >> c1 >> c2 >> c3) { int result = 0; for (int i=1; i <= 10; i++) { if (i != c1 && i != c2 && i != c3) { if (c1 + c2 + i <= 20) { result++; } } } //printf("%f.5\n",(double)result/7); if ((double)result/7 >= 0.5) { cout << "YES" << endl; }else { cout << "NO" << endl; } } }