Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: simon

Problemset: อะนาแกรม 1

Language: cpp

Time: 0.002 second

Submitted On: 2026-05-02 11:30:47

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string name;
	cin >> name;
	int counta = 0;
	int countb = 0;
	int countc = 0;
	int countd = 0;
	int counte = 0;
	int countf = 0;
	int countg = 0;
	int counth = 0;
	for(int i = 0;i < name.size();i++)
	{
		if(name[i] == 'A')counta += 1;
		else if(name[i] == 'B')countb += 1;
		else if(name[i] == 'C')countc += 1;
		else if(name[i] == 'D')countd += 1;
		else if(name[i] == 'E')counte += 1;
		else if(name[i] == 'F')countf += 1;
		else if(name[i] == 'G')countg += 1;
		else if(name[i] == 'H')counth += 1;
	}
	cout << counta << " " << countb << " " << countc << " " << countd << " " << counte << " " << countf << " " << countg << " " << counth << " "; 
}