はまやんはまやんはまやん

hamayanhamayan's blog

年齢って毎年変わるし覚えるの難しいよね [yukicoder No.530]

https://yukicoder.me/problems/no/530

解法

https://yukicoder.me/submissions/183042
Y = 2017だと0才
Y = 2016だと1才
みたいに考えていくと、2017-Y才が答えだと分かる。

int Y;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> Y;

    int ans = 2017 - Y;
    cout << ans << endl;
}