よじろめ覚書

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

ABC028B - 文字数カウント

問題:B - 文字数カウント

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

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

int main(void) {
    string s;
    int cnt[6] = {0};

    cin >> s;
    REP(i, s.length()) {
        cnt[s[i] - 'A']++;
    }

    REP(i, 6) {
        (i != 6 - 1)? printf ("%d ", cnt[i]) : printf ("%d\n", cnt[i]);
    }

    return 0;
}