Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Boeing12345

Problemset: อะนาแกรม 1

Language: cpp

Time: 0.005 second

Submitted On: 2026-09-24 13:54:12

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
    string a;
    cin >> a;
    vector<string> v;
    vector<string> v1;
    if(a.length() <= 10000){
        for(size_t i = 0; i < a.length(); i++){
            int ascii = a[i];
            if(ascii > 72 || ascii < 65){
                return 0;
            }
        }
        for(size_t i = 0; i < a.length(); i++){
            if(a[i] == 'A'){
                v.push_back("A");
            }
            if(a[i] == 'B'){
                v.push_back("B");
            }
            if(a[i] == 'C'){
                v.push_back("C");
            } 
            if(a[i] == 'D'){
                v.push_back("D");
            } 
            if(a[i] == 'E'){
                v.push_back("E");
            } 
            if(a[i] == 'F'){
                v.push_back("F");
            } 
            if(a[i] == 'G'){
                v.push_back("G");
            } 
            if(a[i] == 'H'){
                v.push_back("H");
            } 

        }   
        int A = count(v.begin(), v.end(), "A");
            v1.push_back(to_string(A));
            v1.push_back(" ");
        int B = count(v.begin(), v.end(), "B");
            v1.push_back(to_string(B));
            v1.push_back(" ");
        int C = count(v.begin(), v.end(), "C");
            v1.push_back(to_string(C));
            v1.push_back(" ");
        int D = count(v.begin(), v.end(), "D");
            v1.push_back(to_string(D));
            v1.push_back(" ");
        int E = count(v.begin(), v.end(), "E");
            v1.push_back(to_string(E));
            v1.push_back(" ");
        int F = count(v.begin(), v.end(), "F");
            v1.push_back(to_string(F));
            v1.push_back(" ");
        int G = count(v.begin(), v.end(), "G");
            v1.push_back(to_string(G));
            v1.push_back(" ");
        int H = count(v.begin(), v.end(), "H");
            v1.push_back(to_string(H));
        for(size_t i = 0; i < v1.size(); i++){
                cout << v1[i];
            }
        

    }
}