๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ/PS

[๋ฐฑ์ค€] ์•ŒํŒŒ๋ฒณ ๊ฐœ์ˆ˜(10808), C++

by candosh 2024. 11. 10.

๐Ÿ”— ๋ฌธ์ œ ๋งํฌ

https://www.acmicpc.net/problem/10808

โœ๐Ÿป ๋ฌธ์ œ ์„ค๋ช…

๐Ÿ’๐Ÿป‍โ™€๏ธ ๋‚ด ํ’€์ด

์•„์Šคํ‚ค์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ’€๋ฉด ๋œ๋‹ค!

 

๋Œ€๋ฌธ์ž A๋Š” 65๋ถ€ํ„ฐ ์‹œ์ž‘, ์†Œ๋ฌธ์ž a๋Š” 97๋ถ€ํ„ฐ ์‹œ์ž‘

 

65-90 A-Z Uppercase letters

97-122 a-z Lowercase letters

 

๐Ÿค– ์ฝ”๋“œ

#include <iostream>
using namespace std;

int main()
{
	int Alpha[26] = {0,};
	string c;

	cin >> c;

	for (int i = 0; i < c.size(); i++)
	{
		Alpha[c[i] - 'a']++;
	}

	for (int i = 0; i < 26; i++)
	{
		cout << Alpha[i] << " ";
	}

	return 0;
}