별건 아니고 그냥 공부하다가 소소한 지식들 보관용
- 전역변수에서 배열을 선언하면 알아서 0으로 초기화된다.
- 다음과 같이 배열를 이용하면 빈도수를 측정 가능하다.
int freq[26];
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
for(auto c : s)
freq[c-'a']++;
for(int i = 0; i < 26; i++)
cout << freq[i] << ' ';
}