알고리즘

[체감난이도/최하] 백준 10808번 알파벳 개수

심재철 2017. 8. 28. 23:15

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int c[26];
 
int main()
{
    string str;
    getline(cin, str);
 
    for (int i = 0; i < str.size(); i++)
        c[str[i] - 'a']++;
 
    for (int i = 0; i < 26; i++)
        cout << c[i] << " ";
 
    
    return 0;
}
cs