Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Kei

Problemset: อะนาแกรม 1

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-08 13:32:43

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;

void solve(){
    string s;
    cin >> s;
    int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0;
    for(char& tc : s){
        if(tc=='A'){
            a++;
        }
        if(tc=='B'){
            b++;
        }
        if(tc=='C'){
            c++;
        }
        if(tc=='D'){
            d++;
        }
        if(tc=='E'){
            e++;
        }if(tc=='F'){
            f++;
        }
        if(tc=='G'){
            g++;
        }
        if(tc=='H'){
            h++;
        }
    }
    cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<' '<<g<<' '<<h<<' ';
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}