Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 코테
- 정석학술정보관
- coding
- 스택
- 컴공
- 알고리즘
- Operating System
- 오에스
- 문제풀이
- 그래프
- Stack
- DP
- bfs
- 구현
- Computer science
- 컴퓨터공학과
- 오퍼레이팅시스템
- OS
- 백준
- 정석
- vector
- 코딩
- 자료구조
- cs
- 북리뷰
- 개발
- 컴공과
- c++
- 너비우선탐색
- 브루트포스
Archives
- Today
- Total
Little Jay
[C++] 백준 10809번 알파벳 찾기 본문
string의 find 메소드를 사용하면 간단하게 풀 수 있다.
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
string comp = "abcdefghijklmnopqrstuvwxyz";
int arr[25]{ -1 };
for (int i = 0; i < comp.length(); i++) {
cout << (int)s.find(comp[i]) << " ";
}
return 0;
}'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 10773번 제로 (0) | 2021.03.21 |
|---|---|
| [C++] 백준 1152번 단어의 개수 (0) | 2021.03.21 |
| [C++] 백준 2577번 숫자의 개수 (0) | 2021.03.14 |
| [C++] 백준 10814번 나이순 정렬 (0) | 2021.03.11 |
| [C++] 백준 10250번 ACM호텔 (0) | 2021.03.11 |
Comments