Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Catpao

Problemset: อะนาแกรม 1

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-23 13:21:57

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int counta=0,countb=0,countc=0,countd=0,counte=0,countf=0,countg=0,counth=0;
	string a;
	cin>>a;
	for(int i=0;i<10000;i++){
		if(a[i] == '\0'){
			break;
		}
		else if(a[i] == 'A'){
			counta++;
		}
		else if(a[i] == 'B'){
			countb++;
		}
		else if(a[i] == 'C'){
			countc++;
		}
		else if(a[i] == 'D'){
			countd++;
		}
		else if(a[i] == 'E'){
			counte++;
		}
		else if(a[i] == 'F'){
			countf++;
		}
		else if(a[i] == 'G'){
			countg++;
		}
		else if(a[i] == 'H'){
			counth++;
		}
	}
	cout<<counta<<' '<<countb<<' '<<countc<<' '<<countd<<' '<<counte<<' '<<countf<<' '<<countg<<' '<<counth;  
}