728x90
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
string alpha = "abcdefghijklmnopqrstuvwxyz";
cin >> s;
for (int i = 0; i < alpha.length(); i++)
cout << (int)s.find(alpha[i]) << " "; // string STL의 find 함수는 입력 문자열이
// 최초로 등장하는 위치의 인덱스를 반환하는 함수
return 0;
}
728x90
'C++' 카테고리의 다른 글
[C++] yaml-cpp 사용하기 (0) | 2024.04.10 |
---|---|
[C++] 로그 남기기 (2) | 2024.01.25 |
[백준] C++ 4673번 셀프 넘버 (0) | 2022.03.07 |
[백준] C++ 4344번 평균은 넘겠지 (0) | 2022.02.28 |
[백준] C++ 8958번 OX퀴즈 (0) | 2022.02.28 |