よじろめ覚書

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

ABC054A - One Card Poker

問題:B - Template Matching

#include <iostream>
#include <string>
using namespace std;

int main(void) {
    const string ret[3] = {"Alice", "Bob", "Draw"};
    int a, b, pos;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b;
    a = (a == 1)? a + 13 : a;
    b = (b == 1)? b + 13 : b;
    if (a > b) {
        pos = 0;
    } else if (a < b) {
        pos = 1;
    } else {
        pos = 2;
    }

    cout << ret[pos] << "\n";
    return 0;
}