よじろめ覚書

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

ABC119B - Digital Gifts

問題:B - Digital Gifts

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

#define RATE 380000.0

int main(void) {
    int n;
    double x, ans = 0.0;
    string u;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    REP(i, n) {
        cin >> x >> u;
        ans += (u == "BTC")? x * RATE : x;
    }

    cout << fixed << setprecision(10) << ans << "\n";
    return 0;
}