10808 C++

    [C++] 10808번: 알파벳 개수

    https://www.acmicpc.net/problem/10808 10808번: 알파벳 개수 단어에 포함되어 있는 a의 개수, b의 개수, …, z의 개수를 공백으로 구분해서 출력한다. www.acmicpc.net 풀이 문자열의 원리를 이해하고 있으면 쉽게 풀 수 있는 문제이다. 나의 코드 #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; vector v(26); cin >> s; for (char c : s) { int num = c - 97; v[num]++; } for (int a : v) { cout s; for (char a = 'a'; a