๐ ๋ฌธ์ ๋งํฌ
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;
}
'๊ฐ๋ฐ > PS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค] ํฐ๋ฆฐ๋๋กฌ์ธ์ง ํ์ธํ๊ธฐ(10988), C++ (0) | 2024.11.11 |
---|---|
[๋ฐฑ์ค] ํธ๋ญ์ฃผ์ฐจ(2979), C++ (0) | 2024.11.11 |
[๋ฐฑ์ค] ์ผ๊ณฑ๋์์ด(2309), C++ (2) | 2024.11.09 |
[ํ๋ก๊ทธ๋๋จธ์ค] ๋คํธ์ํฌ, C++ (1) | 2024.11.08 |
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฒ์ ๋งต ์ต๋จ๊ฑฐ๋ฆฌ, C++ (3) | 2024.11.07 |