Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: faofao

Problemset: อะนาแกรม 1

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 13:43:30

#include <iostream>
#include <string>
#include <map>
#include <sstream>
using namespace std;

int main(){
    int arr[8] = {0,0,0,0,0,0,0,0} ;
    string s ; cin >> s ;

    for(char ch : s){
        if(ch=='A') arr[0]++;
        if(ch=='B') arr[1]++;
        if(ch=='C') arr[2]++;
        if(ch=='D') arr[3]++;
        if(ch=='E') arr[4]++;
        if(ch=='F') arr[5]++;
        if(ch=='G') arr[6]++;
        if(ch=='H') arr[7]++;
    }

    for(int i=0 ; i<8 ; i++){
        cout << arr[i] << " " ;
    }
}