よじろめ覚書

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

ABC142A - Odds of Oddness

問題:A - Odds of Oddness

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

int main(void) {
    int n;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    cout << fixed << setprecision(10) << (n % 2 == 0? n / 2 / (double) n : (n + 1) / 2 / (double) n) << "\n";
    return 0;
}