Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: thanat
Problemset: อะนาแกรม 1
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-08 20:14:24
#include<iostream>
using namespace std;
int main(){
string n;
cin>>n;
int a,b[8] = {};
a = n.length();
for(int i=0;i<a;i++){
if(n[i]=='A'){
b[0] = b[0]+1;
}
else if(n[i]=='B'){
b[1] = b[1]+1;
}
else if(n[i]=='C'){
b[2] = b[2]+1;
}
else if(n[i]=='D'){
b[3] = b[3]+1;
}
else if(n[i]=='E'){
b[4] = b[4]+1;
}
else if(n[i]=='F'){
b[5] = b[5]+1;
}
else if(n[i]=='G'){
b[6] = b[6]+1;
}
else if(n[i]=='H'){
b[7] = b[7]+1;
}
}
for(int i=0;i<8;i++){
cout<<b[i]<<" ";
}
}