よじろめ覚書

私の理解度重視のソースコードです。

ABC042A - 和風いろはちゃんイージー / Iroha and Haiku (ABC Edition)

問題:A - 和風いろはちゃんイージー / Iroha and Haiku (ABC Edition)

#include <iostream>
using namespace std;

int getFive(int x_num) {
    return (x_num == 5? 1 : 0);
}

int getSeven(int x_num) {
    return (x_num == 7? 1 : 0);
}

int main(void){
    int a, b, c, cnt5 = 0, cnt7 = 0;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b >> c;

    cnt5 = getFive(a) + getFive(b) + getFive(c);
    cnt7 = getSeven(a) + getSeven(b) + getSeven(c);

    cout << (cnt5 == 2 && cnt7 == 1? "YES" : "NO") << "\n";
    return 0;
}