![[C++] 백준 5단계 - 27866번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fctart1%2Fbtr7dM1v78v%2FAAAAAAAAAAAAAAAAAAAAAMoQUB6WtZAn0NDbOlVUN2lCJJH-4qGhO8jucxfc1ZNk%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3Dbi3nsh%252F70a8IP9ygFAyBiPcESNY%253D)
[C++] 백준 5단계 - 27866번 문제자료구조 & 알고리즘/BOJ2023. 4. 1. 03:06
Table of Contents
문제설명
소스코드
#include <iostream>
using namespace std;
int main() {
string input; int n;
cin >> input >> n;
cout << input[n - 1]; //string형은 char형 배열처럼 사용할 수 있다.
}
'자료구조 & 알고리즘 > BOJ' 카테고리의 다른 글
[C++] 백준 5단계 - 9086번 문제 (0) | 2023.04.02 |
---|---|
[C++] 백준 5단계 - 2743번 문제 (0) | 2023.04.02 |
[C++] 백준 4단계 - 1546번 문제 (0) | 2023.04.01 |
[C++] 백준 4단계 - 10811번 문제 (바구니 뒤집기) (0) | 2023.03.31 |
[C++] 백준 4단계 - 3052번 문제 (0) | 2023.03.31 |