PS_Baekjoon
[백준 C++] 27866번 : 문자와 문자열
SMILELY
2023. 4. 16. 18:39
https://www.acmicpc.net/problem/27866
27866번: 문자와 문자열
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$)
www.acmicpc.net
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
cin.tie(NULL);
ios::sync_with_stdio(false);
string s;
int n;
cin >> s >> n;
cout << s[n-1] << '\n';
}